Jump to content
XCOMUFO & Xenocide

Ufo's On Globe


rincewind

Recommended Posts

Hi,

 

I added a preliminary simulation engine allowing missions on the globe to be executed. Currently there is only one type of mission implemented. That is VisitMission which goes to a particular point and returns to the starting point.

If you want to try it out, grab the lastest SVN-checkout and in planetview use the console to execute the following command:

 

Simulation.spawnVisit(, , , )

 

Latitude and Longitude are Geocoordinates in degrees. If you are unsure of what to put, just use this

Simulation.spawnVisit(0, 0, 51, -7)

to have it pay a visit to my home town :-)

 

After you are done playing with it, comment on the design of the Simulation stuff.

 

Greetings,

 

Rincewind

Edited by rincewind
Link to comment
Share on other sites

Long/Lat use pretty large degrees, in the 1000s of miles. Does the engine support minutes and seconds of Longitude/Latitude?

Just use floating point values. I know you have to do the calculations from minutes to fraction yourself, but it makes it a lot easier for the calculations

 

Rincewind

Link to comment
Share on other sites

Update: For those interested, there is now an overmind AI as well. Admittedly, it's not very smart (just spawn an ufo mission to a random location on average once a day), but at least you no longer have to type to have something moving.

 

Also, this shows off the lua scripting capabilities that guyver implemented. Take a look at ai.lua in data/scripts/ directory, should be pretty straightforward to edit if you want. Basicly the overmindCallback function gets called each game-tick with the number of seconds in gametime that have passed since the last call.

 

Thats it for now, I'll try to keep you up to date on my progress.

 

Rincewind

Link to comment
Share on other sites

it seems that the "overmind AI" sometimes generates invalid longitude values, as i get this error from time to time.

I couldn't immediatly see any error. I improved the exception text to report the actual number that caused it. Can you update and post a new screenshot once you get it again. Somehow it wouldn't show here...

 

Thanks,

 

Rincewind

Link to comment
Share on other sites

it seems that the "overmind AI" sometimes generates invalid longitude values, as i get this error from time to time.

I couldn't immediatly see any error. I improved the exception text to report the actual number that caused it. Can you update and post a new screenshot once you get it again. Somehow it wouldn't show here...

 

Thanks,

 

Rincewind

 

This is the exception I got. Hope it helps.

post-4988-1112434212_thumb.png

Link to comment
Share on other sites

it seems that the "overmind AI" sometimes generates invalid longitude values, as i get this error from time to time.

I couldn't immediatly see any error. I improved the exception text to report the actual number that caused it. Can you update and post a new screenshot once you get it again. Somehow it wouldn't show here...

 

Thanks,

 

Rincewind

 

This is the exception I got. Hope it helps.

Thanks for the help. I fixed it. It wasn't even in the AI code, but in the low-level stuff inside geoposition. Thats what threw me off in the beginning.

 

Greetings,

 

Rincewind

Link to comment
Share on other sites

  • 2 weeks later...

I just noticed that on my cosole:

 

19:10:22: [INFO] xenocommon.console - Lua error: ...ty/Xenocide/xenocidegame/data/../data/scripts/ai.lua:18: attempt to index global `StaticData' (a nil value)

 

Unfrtunetly random craft doesn't show up now :(

 

Greetings,

Beetle

Link to comment
Share on other sites

I just noticed that on my cosole:

 

19:10:22: [INFO] xenocommon.console - Lua error: ...ty/Xenocide/xenocidegame/data/../data/scripts/ai.lua:18: attempt to index global `StaticData' (a nil value)

 

Unfrtunetly random craft doesn't show up now :(

 

Greetings,

Beetle

 

Hmmm, I assume when Simulation was switched to new Singletons, someone forgot to do the lua-registration in the constructor.

 

I don't have my dev-machine here, so I can't look right now.

 

rincewind

Link to comment
Share on other sites

×
×
  • Create New...