How to change where you start

Need help testing contributed art or code or having trouble getting your newest additions into game compatible format? Confused by changes to data formats? Reading through source and wondering what the developers were thinking when they wrote something? Need "how-to" style guidance for messing with VS internals? This is probably the right forum.
Post Reply
Hicks
Bounty Hunter
Bounty Hunter
Posts: 153
Joined: Sat Oct 22, 2011 9:17 am

How to change where you start

Post by Hicks »

Hey

Looking at setting up a new game setting, where you start of in our solar system. Any idea where the file is for the current start so i can work out the format of the file and go from there?
eracc
Bounty Hunter
Bounty Hunter
Posts: 167
Joined: Mon Nov 28, 2005 8:24 pm
Location: TN, USA
Contact:

Re: How to change where you start

Post by eracc »

Look for the New_Game file under the data directory from an SVN checkout. AFAIK that determines the starting setup for a new game. If you do not "do" SVN, the file name is probably the same on an installed copy of Vega Strike.
http://www.eracc.com/ - Linux, Unix, eComStation (Get rid of proprietary Microsoft and Apple!)
Custom Built, Preloaded PCs, Workstations and Servers - Business, Home and Gamer systems
My custom built Linux Gamer/Personal/Business box: Mageia Linux on - ASUS M4A78, 4GB RAM (Linux "sees" 3.2 GB with a 32-bit kernel), AMD Phenom Quad-core @ 2.6GHz, Radeon X1650 Pro PCIe, "sda" 250GB WD2500AAKS-0, "sdb" 150GB WD1500ADFD-0 (Raptor), "sdc" 150GB WD1500ADFD-0 (Raptor), "sdd" 500GB ST3500418AS, "xfs" file system on all but the / partition which is using "ext4".
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: How to change where you start

Post by klauss »

New_Game is a savegame, so you can edit it as any other savegame, or you can save while you're at Sol and use that savegame as New_Game.

But, in general, in constructing a New_Game savegame, you launch VS with a specific mission file (I think explore_universe was used for New_Game). The mission file leaves you flying some predefined ship in some predefined system (all of which is defined in the mission xml), and you can set your ship however you like it before hitting "save" and saving as New_Game.

We usually also strip all dynamic universe stuff from the savegame, since we want each new game to have a different dynamic universe setting (rather than a snapshot of what you saved). It's not easy to do that, so another option is to disable dynamic universe generation by editing the python modules that do that (I don't remember which are they, I would have to grep), just until you save your New_Game file.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
Hicks
Bounty Hunter
Bounty Hunter
Posts: 153
Joined: Sat Oct 22, 2011 9:17 am

Re: How to change where you start

Post by Hicks »

being playing with this again, its set up so you start in the sol system, just having some trouble trying to get the ship to start at earth. I noticed in the original game, the starting location was approx that of atlantis (possibly the dock point) but with earth, i can't even find the location of it in the sol.system file.

Code: Select all

unit_to_dock_with 10 9.000000 65.000000 116.000000 108.000000 97.000000 110.000000 116.000000 105.000000 115.000000 0.000000 
not sure if i should be playing with this line either. I've checked the wiki and can't find anything in there to help.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: How to change where you start

Post by klauss »

That's the name of the base in ascii numbers.

Whoever thought of that way of saving the name should go to a shrink though ;)

Code: Select all

claudiofreire@klauss:~$ python
>>> map(chr,[9,65,116,108,97,110,116,105,115,0])
['\t', 'A', 't', 'l', 'a', 'n', 't', 'i', 's', '\x00']
>>> 
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
travists
Expert Mercenary
Expert Mercenary
Posts: 893
Joined: Thu Jul 08, 2010 11:43 pm
Location: Sol III North American Continent

Re: How to change where you start

Post by travists »

Ugly, with some of the characters in the alien names, I can see why, partly, but can't python do

Code: Select all

name = "Atlan" + chr(116) + "is"

To get Atlantis?
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: How to change where you start

Post by klauss »

It's not python doing it, it's C. I've seen the code, and shivered.
No real reason that I can think of to do it that way. But it's done that way, and changing it would break savegame compatibility.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
travists
Expert Mercenary
Expert Mercenary
Posts: 893
Joined: Thu Jul 08, 2010 11:43 pm
Location: Sol III North American Continent

Re: How to change where you start

Post by travists »

C!? I don't remember much of my C class, but I know C can put strings of strings together if special characters that would be interpreted as code are needed. WOW! If that is representative of the kind of mess some of the legacy code introduces a tear-down may be in order.
Hicks
Bounty Hunter
Bounty Hunter
Posts: 153
Joined: Sat Oct 22, 2011 9:17 am

Re: How to change where you start

Post by Hicks »

klauss wrote:It's not python doing it, it's C. I've seen the code, and shivered.
No real reason that I can think of to do it that way. But it's done that way, and changing it would break savegame compatibility.
Changing it may break savegame compatibility, but i have a feeling it will make things a hell of a lot easier in the future.

Edit:

Code: Select all

unit_to_dock_with 10 9.000000 69.000000 97.000000 114.000000 116.000000 104.000000 0.000000 
doesn't work, hint?
charlieg
Elite Mercenary
Elite Mercenary
Posts: 1329
Joined: Thu Mar 27, 2003 11:51 pm
Location: Manchester, UK
Contact:

Re: How to change where you start

Post by charlieg »

klauss wrote:It's not python doing it, it's C. I've seen the code, and shivered.
No real reason that I can think of to do it that way. But it's done that way, and changing it would break savegame compatibility.
You can write a save game converter though. It wouldn't be that hard to rip the C code out and put it in its own project.

Do save game files include the version they were saved in?
Free Gamer - free software games compendium and commentary!
FreeGameDev forum - open source game development community
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: How to change where you start

Post by klauss »

No version.

And the first number (the 10) is the number of characters in the string. You have to change it too.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
Hicks
Bounty Hunter
Bounty Hunter
Posts: 153
Joined: Sat Oct 22, 2011 9:17 am

Re: How to change where you start

Post by Hicks »

klauss wrote: And the first number (the 10) is the number of characters in the string. You have to change it too.
Had a feeling it was, but putting it as 7 crashes the game when it starts up, or is there something else i need to change with it
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: How to change where you start

Post by klauss »

Honestly, it should work. I'm puzzled.

But I just noticed that there is a compatible way of storing it in a more readable/compact way, and that new savegames do use it. I did it myself, I just forgot! :o

Didn't test it, but should be something like:
Crucible/Cephid_17^13500.000000^Llama.begin 119990000000.000000 -9000000.000000 -109990000000.000000
0 mission data 0
0 missionstring data 1
17 unit_to_dock_with1 5 Earth
I highlighted what I changed. Didn't change the first line, you change that one ;)
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
Hicks
Bounty Hunter
Bounty Hunter
Posts: 153
Joined: Sat Oct 22, 2011 9:17 am

Re: How to change where you start

Post by Hicks »

yeah that does work now, well it starts you off docked at earth, (i think/hope its earth), but when you undock you are in the middle of nowhere. When you normally undock from a station, do you get placed at a set point, or the position that you docked from?

edit: is there any way to get a readout of your position in a solar system? If so i can just fly to earth, and copy the coordinates.
travists
Expert Mercenary
Expert Mercenary
Posts: 893
Joined: Thu Jul 08, 2010 11:43 pm
Location: Sol III North American Continent

Re: How to change where you start

Post by travists »

Fly to earth, Save the game, exit, edit save game and coppy your ship's coords from there?
Hicks
Bounty Hunter
Bounty Hunter
Posts: 153
Joined: Sat Oct 22, 2011 9:17 am

Re: How to change where you start

Post by Hicks »

thankyou for that idea, works perfectly now.
charlieg
Elite Mercenary
Elite Mercenary
Posts: 1329
Joined: Thu Mar 27, 2003 11:51 pm
Location: Manchester, UK
Contact:

Re: How to change where you start

Post by charlieg »

The first entry in the save game file should be the version number of the game used to save it.

It's OK to add it now, because surely anything saved in 0.5.1 would not be loadable by previous versions of VS.

Then you could make provisions later on for upgrading save games from previous versions.
Free Gamer - free software games compendium and commentary!
FreeGameDev forum - open source game development community
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: How to change where you start

Post by klauss »

That would be a promise of backwards compatibility.

We usually maintain backwards compatibility when possible, though it's not always possible, even without the version field, because most data points in VS are tagged somehow and new savegame fields can be introduced without breaking anything, old fields can be parsed and translated.

Some fields only become hard to modify in backwards-compatible ways, like the first line, which has no explicit tag.

I don't think a version number would be sooo beneficial. Rather, tagging every instead of most fields would work it out. Tagging the first line of the savegame is a compatibility-breaker, so if we do it, we should do it only when some other incompatible savegame change is introduced, IMO.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
charlieg
Elite Mercenary
Elite Mercenary
Posts: 1329
Joined: Thu Mar 27, 2003 11:51 pm
Location: Manchester, UK
Contact:

Re: How to change where you start

Post by charlieg »

No, it wouldn't be a promise of backwards compatibility. It would enable you to do it in certain situations, should you choose to. However, what it DOES allow you to do is post a nice helpful, "This save game is for a non-compatible version of Vega Strike!" Surely this is much better to it just not working, or partially working, or whatever currently happens.
Free Gamer - free software games compendium and commentary!
FreeGameDev forum - open source game development community
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: How to change where you start

Post by klauss »

Yes, but the change in itself is incompatible, so it would have to be done along with the next incompatible change. So as not to break savegames unnecessarily.

We haven't had a need to break savegame compatibility since the last release though.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
Hicks
Bounty Hunter
Bounty Hunter
Posts: 153
Joined: Sat Oct 22, 2011 9:17 am

Re: How to change where you start

Post by Hicks »

Is there anyway to enable the player to select a new game from a list of 2 or more different ones? eg have the current new game senario, and have one that starts from earth? What would be required to add that functionality into the game
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Re: How to change where you start

Post by pheonixstorm »

There may be a way to do it, though it would be outside the game. I'm not sure if the old game launcher handled that or not. I know the old launcher program would allow you to change what mission file to start with but i'm not so sure about the new_game file.
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: How to change where you start

Post by klauss »

Hicks wrote:Is there anyway to enable the player to select a new game from a list of 2 or more different ones? eg have the current new game senario, and have one that starts from earth? What would be required to add that functionality into the game
It would require those save games, and a little bit of python coding (not much). Not to mention the artwork for the main menu.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
Post Reply