CTF / StyBall / Shooting Patch

Something else for Armagetron? Goody!
User avatar
the pig
Average Program
Posts: 78
Joined: Thu Nov 24, 2005 6:58 pm

CTF / StyBall / Shooting Patch

Post by the pig »

Hi all,

I finally got to a point where CTF and StyBall were fairly stable, and I've stopped making major changes. Here is the patch.

This also includes all of the shooting / zombie / self destruct support from before.

To patch, download the 0.2.8.2.1 source from SourceForge or check out the 0.2.8.2 branch from Subversion. Then unzip and apply this patch file to the armagetronad directory.

After that, configure and build like you would normally. If you've never done this before, it would help greatly if you could just download the source, build it, and try to run a server first without this patch.

Thanks for all the comments and feedback. I'm going to have some downtime soon, so I may not be around much. I'll try and help whoever wants to try the patch as best I can.

EDIT: EDIT: EDIT: EDIT: Removed patch. See this post for the latest: http://forums.armagetronad.net/viewtopic.php?t=9441
Attachments
pigsty-061015.zip
Patch for 0.2.8.2 source for CTF / StyBall / Shooting
(44.84 KiB) Downloaded 730 times
Last edited by the pig on Sun Oct 22, 2006 6:07 am, edited 5 times in total.
groundpigs don't fly
User avatar
the pig
Average Program
Posts: 78
Joined: Thu Nov 24, 2005 6:58 pm

Post by the pig »

I should also mention that there are a couple of new zone types that maps will accept locally. The "flag" zone is the flag in CTF. The "ball" zone is the ball in StyBall. For both of those game types, the "fortress" zone acts as the flag base or ball goal. Unfortunately, clients won't recognize these types so some hoop jumping is required.

To get the CTF and StyBall maps working, copy the armagetronad\resource\Your_mom directory and everything underneath to your server resource directory. The maps contained there have a version online without the "flag" and "ball" types, while the local copy has them, plus a dtd that defines the types. Many thanks to Your_mom for making those maps and dtd.

You should be able to do this with any map, by creating a local copy in your resource directory, changing the dtd to point to the one in the Your_mom/dtd directory, and adding the flag / ball / fortress zones to it.

Examples of server configs are in the armagetronad\config\examples directory in the patch: settings_sty_ctf.cfg, settings_sty_ball.cfg, and settings_pig_sty.cfg

The language file also has changes. Only the english language one has been updated. If your server is missing the new language entries after you get it running, copy armagetronad\language\english_base.txt to your language directory.

Here is the list of new configs I added. This is the default set in the armagetronad\config\settings_dedicated.cfg file in the patch too.

Code: Select all

############################################################################################
#
# Shooting / Self Destruct / Zombies
#
############################################################################################

# The braking reservoir used for shooting goes from 1.0 (Full) to 0.0 (Empty)
# All of the shot thresholds are calculated from the amount of reservoir used
# To disable shooting, set SHOT_THRESH to 1.0

SHOT_THRESH 2              # Amount of brake reservoir that will make a shot, > 1.0 to disable shooting, 0.001 will enable shooting
SHOT_DISCARD_TIME 0.3      # Time in seconds to hold off shooting between shots
SHOT_START_DIST 1.0        # Starting distance of a shot from the cycle
SHOT_VELOCITY_MULT 1.8     # Cycle velocity is multiplied by this to calculate shot velocity
SHOT_RADIUS_MIN 0.7        # Minimum radius for a shot (As if minimum reservoir was used)
SHOT_RADIUS_MAX 5.0        # Maximum radius for a shot (Full reservoir used)
SHOT_ROT_MIN 2.0           # Minimum rotation for a shot (As if minimum reservoir was used)
SHOT_ROT_MAX 10.0          # Maximum rotation for a shot (Full reservoir used)
SHOT_EXPLOSION 0           # 0 for no explosion, 1 for explosion centered at cycle, 2 for explosion centered on shot

MEGA_SHOT_THRESH 2         # Amount of brake reservoir that will make a megashot, > 1.0 to disable, 0.98 is normal to enable this
MEGA_SHOT_MULT 0.3         # Radius and rotation calculated for a normal shot, then multipled by this for mega
MEGA_SHOT_DIR 3            # Number of directions to shoot around cycle, 0 to disable the shots (cycle explosion still works)
MEGA_SHOT_EXPLOSION 1      # 0 for no explosion, 1 for explosion centered at cycle, 2 for explosion centered on each shot, 3 for both

SHOT_KILL_SELF 0           # (0,1) if set to 1, your own shot kills you or your team
SHOT_KILL_VANISH 1         # (0,1) if set to 1, shot vanishes after killing someone
DEATH_SHOT 1               # (0,1) if set to 1 and you were in the middle of a shot, releases it after you die
SHOT_COLLISION 0           # (0,1) if set to 1, shots collide with each other - WARNING, this is very buggy

SELF_DESTRUCT 0            # (0,1) if set to 1, creates a blast zone when you die
SELF_DESTRUCT_RADIUS 18    # Radius of the self destruct zone at the largest
SELF_DESTRUCT_ROT 7        # Rotation of the self destruct zone
SELF_DESTRUCT_RISE 5       # Rise speed of the self destruct zone - 0 to start at largest
SELF_DESTRUCT_FALL 2       # Fall speed of the self destruct zone - 0 to leave there
SELF_DESTRUCT_VANISH 1     # (0,1) if set to 1, self destruct zone vanishes quickly after a kill

SHOT_SEEK_UPDATE_TIME 0.5  # The time in seconds that seeking shot directions are updated (zombies)

ZOMBIE_ZONE 0              # (0,1) if set to 1, killed players create a zombie zone
ZOMBIE_ZONE_RADIUS 6       # Final radius of the zombie zone
ZOMBIE_ZONE_ROT 2          # Speed of rotation
ZOMBIE_ZONE_RISE 0.4       # Rise speed of the zombie zone
ZOMBIE_ZONE_FALL 0         # Fall speed of the zombie zone, 0 for zombies that don't diminish
ZOMBIE_ZONE_VANISH 0       # (0,1) If 1, zombie will vanish after killing someone other than his killer
ZOMBIE_ZONE_SPEED 12       # Speed of the zombie zone
ZOMBIE_ZONE_SHOOT 1.0      # If > 0, shots will kill of zombies, 1 to decrease zombie size by shot size, > 1 to decrease zombie faster

SCORE_SHOT 1               # points you gain for shooting someone
SCORE_SHOT_SUICIDE 0       # points you gain for shooting yourself
SCORE_DEATH_SHOT 1         # points you gain for shooting someone with your death shot
SCORE_SELF_DESTRUCT 1      # points you gain for blasting someone with your self destruct blast
SCORE_ZOMBIE_ZONE_REVENGE 1 # points you gain for getting your killer with your zombie zone
SCORE_ZOMBIE_ZONE 0        # points you gain for getting anyone but your killer with your zombie zone

############################################################################################
#
# Capture the Flag / Ball / Goal
#
############################################################################################

BASE_RESPAWN 0             # (0,1) if set to 1, any fortress / goal / flag base will respawn the team that owns it if a team player enters it
BASE_ENEMY_RESPAWN 0       # (0,1) if set to 1, any fortress / goal / flag base will respawn the team that owns it if an enemy player enters it

BASE_ENEMY_KILL 0          # (0,1) if set to 1, any fortress / goal / flag base will kill the enemy if they enter it, usually set to 1 for ball games

SCORE_FLAG 3               # points you gain for capturing a flag and returning it to your base
SCORE_GOAL 1               # points you gain for shooting a goal

FLAG_CHAT_BLINK_TIME -1    # time in seconds that the chat triangle above a player with a flag will blink, -1 to disable

FLAG_BLINK_TIME 2          # time in seconds between flag blinking over player with the flag, -1 to disable
FLAG_BLINK_START 0.2       # percentage of the flag radius to start the flag blink at
FLAG_BLINK_END 1.0         # percentage of the flag radius to end the flag blink at
FLAG_BLINK_SPEED 8         # speed at which the flag blink radius increases
FLAG_BLINK_START 0.1       # percentage of the flag radius to start the flag blink at
FLAG_BLINK_ESTIMATE_POSITION 0.6 # 0 to start the flag blink at the current player position, 1 to start the flag blink where the player would be at the end of the blink at current speed and direction
groundpigs don't fly
User avatar
ed
Match Winner
Posts: 613
Joined: Mon Feb 13, 2006 12:34 pm
Location: UK

Post by ed »

Thanks for the patch.
I applied it to 0.2.8.2.1 and all installed without problems.
It appeared to have worked as I ran it with settings_pig_sty.cfg and I got the old shooting zompies server working nicely.
Problems came getting ctf to work.
Copied the dtd to myresource/Your_mom/dtd/map-0.2.8.0_pig2.dtd
Copied the map containing extra zones to myresource/Your_mom/clever/ctfsty-0.0.2.aamap.xml
but when I try to run the server I get:

Code: Select all

Your_mom/dtd/map-0.2.8.0_pig2.dtd:66: validity error : Redefinition of element Resource
<!ELEMENT Resource (Map)>
                         ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:70: validity warning : Attribute type of element Resource: already defined
       name CDATA #REQUIRED
       ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:71: validity warning : Attribute name of element Resource: already defined
       version CDATA #REQUIRED
       ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:72: validity warning : Attribute version of element Resource: already defined
       author CDATA "Anonymous"
       ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:73: validity warning : Attribute author of element Resource: already defined
       category CDATA "unsorted"
       ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:74: validity warning : Attribute category of element Resource: already defined
       comissioner CDATA #IMPLIED
       ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:75: validity warning : Attribute comissioner of element Resource: already defined
>
^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:77: validity error : Redefinition of element Map
<!ELEMENT Map (Settings?, World)>
                                 ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:79: validity error : Redefinition of element Settings
<!ELEMENT Settings (Setting*)>
                              ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:80: validity error : Redefinition of element Setting
<!ELEMENT Setting EMPTY>
                        ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:81: validity warning : Attribute name of element Setting: already defined
<!ATTLIST Setting name CDATA #REQUIRED>
                                      ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:82: validity warning : Attribute value of element Setting: already defined
<!ATTLIST Setting value CDATA #REQUIRED>
                                       ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:85: validity error : Redefinition of element World
<!ELEMENT World (Field)>
                        ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:90: validity error : Redefinition of element Field
<!ELEMENT Field (Axes?, (Spawn | Wall | Zone)*)>
                                                ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:92: validity error : Redefinition of element Axes
<!ELEMENT Axes (Axis*)>
                       ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:93: validity error : Redefinition of element Spawn
<!ELEMENT Spawn EMPTY>
                      ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:94: validity error : Redefinition of element Wall
<!ELEMENT Wall (Point+) >
                         ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:95: validity error : Redefinition of element Point
<!ELEMENT Point EMPTY>
                      ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:96: validity error : Redefinition of element Axis
<!ELEMENT Axis EMPTY>
                     ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:97: validity error : Redefinition of element Zone
<!ELEMENT Zone (ShapeCircle) >
                              ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:99: validity warning : Attribute version of element Map: already defined
<!ATTLIST Map version CDATA #REQUIRED>
                                     ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:101: validity warning : Attribute logicalBox of element Field: already defined
<!ATTLIST Field logicalBox (true | false) "true">
                                                ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:103: validity warning : Attribute number of element Axes: already defined
<!ATTLIST Axes number CDATA "4">
                               ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:104: validity warning : Attribute normalize of element Axes: already defined
<!ATTLIST Axes normalize (true | false) "true">
                                              ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:106: validity warning : Attribute x of element Spawn: already defined
<!ATTLIST Spawn x CDATA #REQUIRED>
                                 ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:107: validity warning : Attribute y of element Spawn: already defined
<!ATTLIST Spawn y CDATA #REQUIRED>
                                 ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:108: validity warning : Attribute xdir of element Spawn: already defined
<!ATTLIST Spawn xdir CDATA #IMPLIED>
                                   ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:109: validity warning : Attribute ydir of element Spawn: already defined
<!ATTLIST Spawn ydir CDATA #IMPLIED>
                                   ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:110: validity warning : Attribute angle of element Spawn: already defined
<!ATTLIST Spawn angle CDATA #IMPLIED>
                                    ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:111: validity warning : Attribute length of element Spawn: already defined
<!ATTLIST Spawn length CDATA "1.0">
                                  ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:113: validity warning : Attribute height of element Wall: already defined
<!ATTLIST Wall height CDATA #IMPLIED>
                                    ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:115: validity warning : Attribute x of element Point: already defined
<!ATTLIST Point x CDATA #REQUIRED>
                                 ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:116: validity warning : Attribute y of element Point: already defined
<!ATTLIST Point y CDATA #REQUIRED>
                                 ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:118: validity warning : Attribute xdir of element Axis: already defined
<!ATTLIST Axis xdir CDATA #IMPLIED>
                                  ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:119: validity warning : Attribute ydir of element Axis: already defined
<!ATTLIST Axis ydir CDATA #IMPLIED>
                                  ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:120: validity warning : Attribute angle of element Axis: already defined
<!ATTLIST Axis angle CDATA #IMPLIED>
                                   ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:121: validity warning : Attribute length of element Axis: already defined
<!ATTLIST Axis length CDATA "1.0">
                                 ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:123: validity warning : Attribute effect of element Zone: already defined
<!ATTLIST Zone effect (win | death | fortress | ball | flag) "death" >
                                                                     ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:125: validity error : Redefinition of element ShapeCircle
<!ELEMENT ShapeCircle (Point)>
                              ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:126: validity warning : Attribute radius of element ShapeCircle: already defined
<!ATTLIST ShapeCircle radius CDATA #REQUIRED>
                                            ^
Your_mom/dtd/map-0.2.8.0_pig2.dtd:127: validity warning : Attribute growth of element ShapeCircle: already defined
<!ATTLIST ShapeCircle growth CDATA "0.0">
                                        ^
:50: parser error : XML declaration allowed only at the start of the document
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
     ^
:51: parser error : Extra content at the end of the document
<!DOCTYPE Resource SYSTEM "Your_mom/dtd/map-0.2.8.0_pig2.dtd">
^
[0] Failed to parse
[0] The map Your_mom/clever/ctfsty-0.0.2.aamap.xml(http://www.geocities.com/armagetron_maps/ctfsty-0.0.2.aamap.xml) could not be loaded or parsed; please check your configuration and the log below.
User avatar
Your_mom
Match Winner
Posts: 653
Joined: Sun Jun 06, 2004 1:45 am

Post by Your_mom »

I know what this looks like, but it wasnt me fault <shifty eyes>.

Heh. Anyways to get ctf working you need to download the ctf map(or anymap more or less). Put the dtd in
.../Your_mom/dtd
There shouldnt be a myresource/ its pretty much right after .../included/

You have to modify the map and add the zones, theres a server version for styball somewhere but i pretty much left adding the zones to groundpig this time. Put the modified map in
.../Your_mom/clever/
on the server only.
User avatar
ed
Match Winner
Posts: 613
Joined: Mon Feb 13, 2006 12:34 pm
Location: UK

Post by ed »

I did all those things. the "myresource/" simply refers to the path to my resource directory.

I just checked a few things. Seems I applied the patch twice. Explains a couple of other strangnesses too.

So the map and dtd contained the text twice.

Fixed and is now working.
Thanks.

It's called ed's ctf test at the mo.
I will play with a few settings whaen I have time tomorrow.
User avatar
the pig
Average Program
Posts: 78
Joined: Thu Nov 24, 2005 6:58 pm

Post by the pig »

Good to hear you got it running Ed. Thanks for testing it out. I'll be looking forward to trying it out on your server!
groundpigs don't fly
User avatar
DDMJ
Reverse Outside Corner Grinder
Posts: 1882
Joined: Thu Jun 08, 2006 12:15 am
Location: LA, CA, USA, NA
Contact:

Post by DDMJ »

You are GOD groundpig!!!!!!! What if I hadn't begged you to put your servre back up about 3 months ago when I found you in some random server. We might not have all this amazing stuff!!!!
User avatar
the pig
Average Program
Posts: 78
Joined: Thu Nov 24, 2005 6:58 pm

Post by the pig »

Well, I wouldn't say that. I just hacked a bunch of crap on top of the great game z-man and the rest of the devs have given us. Thanks devs!
groundpigs don't fly
User avatar
ed
Match Winner
Posts: 613
Joined: Mon Feb 13, 2006 12:34 pm
Location: UK

Post by ed »

OK, been messing with this all morning.

It is now called "ed's Capure the Flag in Stonehenge" or something

Set in a modified version of wrtlprnft's wonderful Stonehenge map.

Physics settings are standard fortress settings (with shorter tails).
CTF settings are standard CTF settings.

Let me know what you think.
Basic rules for those who haven't played the original...

Each team has one home zone (the large zone - on this map behind you at the start)
and one flag zone (the small zone - on this map up near the opponents home zone to the left).

To score 3 points you must collect your teams flag and return it to your teams home zone.
You can only return your flag home if the other teams flag is back on it's original spot.
When you sucessfully take your flag home it will be returned to it's original spot.

The player carrying the flag will have a flashing zone around him. If you kill him (or he dies), he will drop his flag.
If you touch the fallen flag of the other team, it will be returned to it's original spot.

Respawning:
If you touch your home zone you will respawn all your teams dead players.
If you touch the opponants zone you will respawn all their players.

I think that's about it as I understand it. If I've missed something, or got something wrong, let me know.
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

While playing on that server I experienced some weird bugs and lag (dunno if it was real–world network lag, though). The thing that comes right at the beginning is defintely a bug, anyways.
Also note how the playback “jumps”: It always renders a few frames, stops for a few milliseconds, then does more frames. Annoying and headache–causing.
There's no place like ::1
User avatar
ed
Match Winner
Posts: 613
Joined: Mon Feb 13, 2006 12:34 pm
Location: UK

Post by ed »

wrtl, It's fine for me. I don't get any of the strange goings on you have.

I've changed the server name now to Crazy Tronners Wild Capture the Flag. For want of a better name.
There's 6 quite different maps, seeing what would work best.
wrtl, maybe try the different maps, see if it's the same on the others.

I've had reports of fps going down and down as the round goes on. It's ok for me, but I have too much memory.

Also, sometimes the flagholder just kind of stays out of trouble and the round goes on and on as he's chased round the grid. If both flagholders do this, I can go and make tea.
Is there a way to say something like, if the flag is not returned sucessfully to the base within n seconds, it is returned to it's spot?
User avatar
the pig
Average Program
Posts: 78
Joined: Thu Nov 24, 2005 6:58 pm

Post by the pig »

ed wrote:I've had reports of fps going down and down as the round goes on. It's ok for me, but I have too much memory.
The same thing happens on my server. I've had reports saying that it has happened on every server that has respawn enabled. z-man checked it out once and thought it might be related to the zones, but I've since fixed zone recycling for flags at least. I think z-man might be too busy to look again anytime soon :B)
ed wrote: Also, sometimes the flagholder just kind of stays out of trouble and the round goes on and on as he's chased round the grid. If both flagholders do this, I can go and make tea.
Is there a way to say something like, if the flag is not returned sucessfully to the base within n seconds, it is returned to it's spot?
Sure, I can add a config for that and make a new patch. Won't be anytime soon though, I think my wife is in labor right now.
groundpigs don't fly
User avatar
ed
Match Winner
Posts: 613
Joined: Mon Feb 13, 2006 12:34 pm
Location: UK

Post by ed »

OK, thanks.
Wish you all the best with the new arrival.

Couple of quick ones to think about...

Is it possible, when a player is in possession of the flag, instead of the flag zone flashing, for it to be constant, and just move smoothly with the player?
It can often be difficult to locate the flag bearer.
I've made mine flash for often, but it gives the poor flagholder a headache.

I was thinking, if so, this could be incorporated with the "get it back to the zone quick" scenario by the making the flag zone get smaller as time goes on, finally diminising completely at which time it is returned to it's spot.
User avatar
the pig
Average Program
Posts: 78
Joined: Thu Nov 24, 2005 6:58 pm

Post by the pig »

Was a false alarm :B)
ed wrote:Is it possible, when a player is in possession of the flag, instead of the flag zone flashing, for it to be constant, and just move smoothly with the player?
Unfortunately, moving smoothly with the player is not possible without a client update to support that. I can make it so you can update the position every X time to approximate the player position and speed though. Keep in mind that every X time, the server will have to send a network sync to do this, which might affect lag.
ed wrote:I was thinking, if so, this could be incorporated with the "get it back to the zone quick" scenario by the making the flag zone get smaller as time goes on, finally diminising completely at which time it is returned to it's spot.
This is also not advisable without a client update. The client currently will remove a zone from the game if it detects that the zone is getting smaller and that the size of it went to zero. If I put that capability in, it is possible that some player would not get the network update in time and would not be able to see the flag any more that round.

So, the most I can offer you is a flag that is above the player all the time, but with choppy movement, and an option for sending the flag back home after a certain amount of time.
groundpigs don't fly
User avatar
ed
Match Winner
Posts: 613
Joined: Mon Feb 13, 2006 12:34 pm
Location: UK

Post by ed »

I have a sort of stuttery flag that sticks to the holder using settings:

FLAG_BLINK_TIME .01
FLAG_BLINK_START 1
FLAG_BLINK_END 1
FLAG_BLINK_SPEED 1
FLAG_BLINK_ESTIMATE_POSITION 0.01

It works for me, makes it easy to spot the flagholders on a grid.
It makes it easier for a beginner to realise that he's carrying something.
But I have had rare reports of some people no longer being able to see the zones, even though I and others still can.
Post Reply