Single player skirmish?

Single player skirmish?

Discuss everything related to running Spring on your chosen distribution of Linux.

Moderator: Moderators

Post Reply
Ahri
Posts: 6
Joined: 06 Aug 2006, 19:12

Single player skirmish?

Post by Ahri »

I don't have a (working) Lobby installed so I can't just bring up some pretty interface that allows me to choose a map, add some bots, and have a game. So I figured I'd just write a really crappy "lobby" in bash script or whatever minimalist scripting would be required, unfortunately the lobby protocol listing is MIA so I can't do that either.

So I'm stuck with nothing to do except much about on my own on maps or have random enemies spawn and come at me, or do some revision for my exam tomorrow, and despite the laws of nature the winner is emerging to be revision. This sort of thing can't be allowed to continue, so I'm imploring you: how can I just play a quick game of single player Spring?
User avatar
Relative
Posts: 1371
Joined: 15 Oct 2006, 13:17

Post by Relative »

Well spring installed via the .debs have two AIs installed by default; AAI and KAI. I'm not sure how, but it should be pretty easy to install the AIs manually if you installed through another method. Also, at least one working Linux lobby should enter a usable state soon. I'm running the pre-beta aflobby, and minus one or two bugs I can play multiplayer no problem.

Edit:
Try installing this.

http://www.fileuniverse.com/?p=show&a=it&id=3932
User avatar
BrainDamage
Lobby Developer
Posts: 1164
Joined: 25 Sep 2006, 13:56

Post by BrainDamage »

to make a starting table (changing maps & players & positions) without using a lobby, check the wiki:

http://spring.clan-sy.com/wiki/Linux_multiplayer_games
Ahri
Posts: 6
Joined: 06 Aug 2006, 19:12

Post by Ahri »

Thanks! I'll have a go at a bash script to generate that file format, a couple of questions first though, what are:
GameMode
StartPosType

And why is NumAllies set to 0 in each of the ALLYTEAM blocks?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Ahri wrote:Thanks! I'll have a go at a bash script to generate that file format, a couple of questions first though, what are:
GameMode
StartPosType
GameMode specifies whether it's commander ends (1) or commander continues (0).
StartPosType specifies whether it's fixed positions (0), random positions (1) or choose positions in game (boxes) (2).
Ahri wrote:And why is NumAllies set to 0 in each of the ALLYTEAM blocks?
Because in the current setup with lobby and such it's impossible to ally allyteams with each other. This script seems to reflect that limitation by setting it to 0 too.

(Note that an allyteam already is a group of teams allied together. And a team is a group of players controlling the same units, just FYI.)
Ahri
Posts: 6
Joined: 06 Aug 2006, 19:12

Post by Ahri »

Ah I see, I was wondering why each player was a "team", and now I understand :)

I've written a script to generate the file and run spring, but sometimes it segfaults, which I think is due to the RgbColors I'm generating at random. Ignoring the fact that colour selection shouldn't result in segfaults (bounds checking? :)) -- what range is safe? I was assuming it was 0-1 with 12 decimal places, since that was what the example script contained. Why isn't it just 0-255 like every other RGB specification on the planet? Floats are so messy...

Also the scripts I generate (example) seem to result in an incorrect list ingame when I hit shift+esc to quit, it's listed as:

Team0 (Ahri) <Enemy>
Team2 (Ahri) <Enemy>
Team3 (Gaia) <Gaia>

I'm not sure why that is...

Anyway the script is available here for anyone interested. Just execute:
springsp map_name me_c ai_a ai_c . ai_a ai_c ai_c

That's: me_c (you: core), ai_a (ai: arm), ai_c (ai: core) . (vs) ai_a ai_c ai_c
Ahri
Posts: 6
Joined: 06 Aug 2006, 19:12

Post by Ahri »

Any hints to avoid segfaulting, and any ideas why the side listing seems mucked up? AF; I'm sure you'd know the reasons as your lobby is the most complete on offer...

Apart from those two things my little script does a decent enough job of generating a script.txt, as long as you can be bothered editing the variables at the top to alter starting metal/energy and the other stuff that I consider "more constant" than map/team selection :)
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

As a windows user I havent ran your script, I'm not keen on languages like python or perl.

edit:: unitsync doesnt give sidenames it gives how many sides there are and then you pass over an index to unitsync in return for a side name.

So unitsync will say there are two sides so you'll do a for loop polling unitsync for the side names. It may be different for python tho.
poloking
Posts: 5
Joined: 04 Jun 2007, 16:01

Post by poloking »

sorry if this sounds stupid but how do i use that script that you have made.

I have been using linux for about 4 years. But, Still a newbie.

cheers
rob
Ahri
Posts: 6
Joined: 06 Aug 2006, 19:12

Post by Ahri »

Nope, not stupid at all; I probably did it very weirdly :)

First edit the file and alter the variables at the top of it, you probably only need to change the "NAME" and "AI", NAME being yours, and AI being the path to the AI library you want to use, mine's set to "/usr/games/lib64/spring/AI/Bot-libs/AAI.so" because I had a 64 bit OS when I installed Spring, yours is most likely "/usr/games/lib/spring/AI/Bot-libs/AAI.so" -- if you're not sure where it is try using

Code: Select all

find / -name AAI.so 2> /dev/null
to find the path :)

I set the game type to XTA, you can use the above trick to find that file (xtape.sd7) and select a different mod (from the same directory or your own .spring/mods directory) if you so choose.

Now, just make it executable (chmod 755 springsp) and run it as I mentioned above; leave the file extension off the map name and add whatever players you like.

Sorry if this seems overly complex; after the first time you'll probably only need to edit the script to change the mod :-)

Since nobody's bothered to enlighten me as to why the colour floats I've used *sometimes* crash Spring, you'll have to just run the script again if it segfaults; just roll the dice ;-)

On that note, can anyone tell me why Spring segfaults when certain values are chosen for the team colours? This happens right at the start when the AI join the game.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Does it reproducably crash on certain color values, or does it just crash sometimes? In the last case it's probably unrelated to the color values, but just a random crash in either Spring or the AI.
Post Reply

Return to “Linux”