Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
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 1412 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 Kernel


Medals: 159
Projects: 23
Exp: 18 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..

Kev

Offline Daire Quinlan

Junior Member





« 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 ...

D.
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  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (16 views)
2014-08-28 18:26:30

CopyableCougar4 (25 views)
2014-08-22 19:31:30

atombrot (38 views)
2014-08-19 09:29:53

Tekkerue (34 views)
2014-08-16 06:45:27

Tekkerue (32 views)
2014-08-16 06:22:17

Tekkerue (20 views)
2014-08-16 06:20:21

Tekkerue (31 views)
2014-08-16 06:12:11

Rayexar (66 views)
2014-08-11 02:49:23

BurntPizza (44 views)
2014-08-09 21:09:32

BurntPizza (34 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org 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‑gaming.org
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!