Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (754)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  howto implement FTL 'movement' in a scifi turn based strategy idea ?  (Read 2041 times)
0 Members and 1 Guest are viewing this topic.
Offline ops

Junior Newbie

« Posted 2005-06-15 03:02:38 »

from a student a request for guidance ..

from various scifi novels ops has aggregated a science fiction future to model as a game or 'simulation'.

in this alternate faster than light transits are a little less convenient than ones normal star wars, star trek or battlestar galactica variants.

In our present design every stellar system keeps a record of all insystem assets. to 'move' from a to b involves removing assets from a stellar systems records and adding them to the destinations systems records in some future turn.

while a spine or complex is subject to the 'rules' of FTL interstellar transit that asset is effectively 'frozen' and can neithr react to real space demands nor engage in normal activity. Think the sleepers in 2001 or aliens.

So it would seem to our poor addld wits that while asleep in transit these concrete instantiations cannot allow anything to call their methods ? How does one put an object to sleep ? Ops is toying with doing an 'intransit' exception ?

Comments and/or suggestions ?
Offline kevglass

« JGO Spiffy Duke »

Medals: 319
Projects: 25
Exp: 22 years

Coder, Trainee Pixel Artist, Game Reviewer

« Reply #1 - Posted 2005-06-15 07:15:01 »

Depends how complicated you objects are I guess.

- If they're simple and a small number then the exception idea is pretty sound. Similar to InvalidStateException thats existed for donkeys years.

- If there are loads of complicated classes that you want to "sleep" you could consider generating dynamic proxies for them that can be shut off at the proxy level. Basically just generate another class that proxies all the methods of the target automatically.

- Or change you stuff to a facade pattern and use the single point of entry to check the sleeping state.

Just ideas..


Offline Daire Quinlan

Junior Devvie

« Reply #2 - Posted 2005-06-15 07:39:48 »

 Or stick the reference into an 'inTransit' object that has a record of where the asset has come from, where its going, and what time its going to get there at, and stick the 'insTransit' object into a 'TransitBuffer' thats polled once a turn to see if you have to pop anything out and place the contained reference into the destiniation system assetlist. I reckon thats probably the -simplest- way to do it ...

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ops

Junior Newbie

« Reply #3 - Posted 2005-06-15 16:47:03 »

thank you daire, your suggestion was our first approach but we felt uneasy about the shuffling of references between too many structures ?

thank kevglass.

we were reluctant to define exceptions as that approach seemed to imply lots of try/catch blocks so ops appreciates and will devote further study to the suggestion to investigate dynamic proxies.

most useful, as example, that a proxy object seems able to not only isolate but also override an in transit asset's methods. very handy as in our model assets consume resources at different rates depending upon whether they exist in real space or are 'in transit'.

Pages: [1]
  ignore  |  Print  

DesertCoockie (21 views)
2018-05-13 18:23:11

nelsongames (69 views)
2018-04-24 18:15:36

nelsongames (66 views)
2018-04-24 18:14:32

ivj94 (750 views)
2018-03-24 14:47:39

ivj94 (80 views)
2018-03-24 14:46:31

ivj94 (604 views)
2018-03-24 14:43:53

Solater (96 views)
2018-03-17 05:04:08

nelsongames (169 views)
2018-03-05 17:56:34

Gornova (387 views)
2018-03-02 22:15:33

buddyBro (1047 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!