Jump to content


Photo

Ufo's On Globe


  • Please log in to reply
12 replies to this topic

#1 rincewind

rincewind

    Programming Department

  • Xenocide Programming Department
  • 541 posts

Posted 26 March 2005 - 06:47 AM

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(<startLatitude>, <startLongitude>, <endLatitude>, <endLongitude>)

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, 26 March 2005 - 06:47 AM.

Posted Image

I love boost!!! The next best thing since the invention of C++.

#2 Penta

Penta

    Sergeant

  • Forum Members
  • PipPipPip
  • 45 posts

Posted 26 March 2005 - 09:00 AM

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

#3 rincewind

rincewind

    Programming Department

  • Xenocide Programming Department
  • 541 posts

Posted 26 March 2005 - 09:16 AM

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

<{POST_SNAPBACK}>

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
Posted Image

I love boost!!! The next best thing since the invention of C++.

#4 rincewind

rincewind

    Programming Department

  • Xenocide Programming Department
  • 541 posts

Posted 29 March 2005 - 11:04 AM

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
Posted Image

I love boost!!! The next best thing since the invention of C++.

#5 red knight

red knight

    Xenocide Project Leader

  • Xenocide Inactive
  • 3,310 posts

Posted 29 March 2005 - 07:50 PM

Excelent work you two... =d I need an update, that is for sure from the Prg department. ;)

Greetings
Red Knight
Sourceforge Nick: flois - Federico Andres Lois
Visit my blog at: flois.blogspot.com

Posted Image

Pookie cover me, I am going in.

#6 SupSuper

SupSuper

    Programming Department

  • Xenocide Programming Department
  • 2,418 posts

Posted 31 March 2005 - 09:54 PM

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

Attached Files


too bad, now you will never know the ancient secrets of supsupers long gone avatar ;)

Posted Image


#7 rincewind

rincewind

    Programming Department

  • Xenocide Programming Department
  • 541 posts

Posted 01 April 2005 - 04:26 PM

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

<{POST_SNAPBACK}>

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
Posted Image

I love boost!!! The next best thing since the invention of C++.

#8 kamikazejay

kamikazejay

    Sergeant

  • Forum Members
  • PipPipPip
  • 10 posts

Posted 02 April 2005 - 03:30 AM

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

<{POST_SNAPBACK}>

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

<{POST_SNAPBACK}>


This is the exception I got. Hope it helps.

Attached Files



#9 rincewind

rincewind

    Programming Department

  • Xenocide Programming Department
  • 541 posts

Posted 02 April 2005 - 06:05 AM

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

<{POST_SNAPBACK}>

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

<{POST_SNAPBACK}>


This is the exception I got. Hope it helps.

<{POST_SNAPBACK}>

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
Posted Image

I love boost!!! The next best thing since the invention of C++.

#10 Beetle

Beetle

    Programming Department

  • Xenocide Inactive
  • 350 posts

Posted 13 April 2005 - 11:16 AM

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
Posted Image

#11 rincewind

rincewind

    Programming Department

  • Xenocide Programming Department
  • 541 posts

Posted 13 April 2005 - 01:19 PM

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

<{POST_SNAPBACK}>


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
Posted Image

I love boost!!! The next best thing since the invention of C++.

#12 Beetle

Beetle

    Programming Department

  • Xenocide Inactive
  • 350 posts

Posted 13 April 2005 - 01:56 PM

Simulation is still old type singleton, strange becouse it works few days ago.

Beetle
Posted Image

#13 rincewind

rincewind

    Programming Department

  • Xenocide Programming Department
  • 541 posts

Posted 15 April 2005 - 12:23 AM

Simulation is still old type singleton, strange becouse it works few days ago.

Beetle

<{POST_SNAPBACK}>

I'll take a look at it tonight.

Rincewind
Posted Image

I love boost!!! The next best thing since the invention of C++.