Server Help

ASSS Custom Projects - Race

Anonymous - Mon Aug 02, 2004 4:19 pm
Post subject: Race
Here is a customisable race module.
sample race.conf wrote:
#define PRIZE_WARP 7
#define PRIZE_THRUST 11
#define PRIZE_SPEED 12


; rectangular checkpoint area (top left and bottom right map tile coord)

;whether checkpoint 0 is the start and the finish

; anyone not in a safe zone on 'gogogo' gets specced

; stages: Ready, Start, CheckPoint, Lap, Death and Finish
; actions: Spec, ShipReset, Prize, WarpXY, ArenaMessage, Message

; message macros:
; name - player's name
; lap - laps completed so far
; chkpt - last checkpoint crossed
; rank - position in the race, 0 if still racing
; time - time in seconds since the race started (#.##)
; # - play bong#.wa2

; example configuration:
Ready-ShipReset = 1
Ready-WarpXY = 512,512
Ready-ArenaMessage=Get ready!

Start-ArenaMessage=GooOOoo Go GO gO!!%104

CheckPoint-Message=checkpoint %chkpt ok%26

Lap-Message=lap %lap time so far %time

Death-ShipReset = 1
Death-Prize = $PRIZE_WARP
Death-ArenaMessage=%name had a fatal accident (%lap laps)

;Finish-Spec = 1
Finish-ArenaMessage=#%rank %time %name

I've been having problems with version 1 and version 2 .zip format, please say if you can't open the file (I might switch to tar.gz as this is mainly for linux anyway).
i88gerbils - Mon Aug 02, 2004 9:31 pm
Post subject:
Is there a Changelog from last version? Nevermind. I'll look at it myself :d.

Stay tuned for an editted suggestion list...
Bak - Mon Aug 02, 2004 10:27 pm
Post subject:
good work, although I'd prefer regions to specifing rectangles... not a big deal
i88gerbils - Mon Aug 09, 2004 6:11 pm
Post subject:
Hmm, documentation for 1.2 isn't correct. I'm guessing all those new "Ready-" and "Finish-" config options aren't enabled yet. Figured as much since WarpOnStart is still there.

Or maybe you didn't put the right source in for this version? Haven't tried the binary yet. Yes, that is the problem.

binary - v1.2
source - v1.1
Smong - Thu Aug 12, 2004 4:04 pm
Post subject:
Anonymous - Fri Aug 13, 2004 12:43 pm
Post subject:
Hopefully this one will contain the correct source code.
i88gerbils - Fri Aug 13, 2004 8:36 pm
Post subject:
First public suggestion:

A checkpoint wav message (just the wav, not the message) seems to be playing after crossing the finish line. This plays a little before the finish message, which may also contain a sound. It doesn't seem like it should do this though...
Anonymous - Wed Aug 18, 2004 5:04 pm
Post subject:
It's actually line 930: do_actions(NULL, p, "CheckPoint"); that is causing the problem. At the moment I don't have the time to come up with a practical solution as things like %chkpt need to work as expected (quick/dirty fix is to comment out line 930, and add else do_actions(NULL, p, "CheckPoint"); at line 971).
i88gerbils - Fri Aug 20, 2004 6:27 pm
Post subject: Race Reward (__Zone Developer__ Discussion)
Smong had told me that eventually the ability to write your own reward (points_race) module will be added into the race module. I'd like to share my ideas on the reward ideas I have come up with, and hope that maybe some other people might suggest some. These would be formulas so that depending on the zone settings, a zone dev can modify a number to reflect that zone's concept.

Currently I have two modes: time-based (Time Trial) and place-based (Competitive).

Code: Show/Hide


In this example, points would be divided evenly across the players according to standing. So if RaceModifier was set at 100, there were 50 players, then the results would be:

1 - 5000
2 - 2500
25 - 200
50 - 100

Every player who finishes gets points. With the current race module, every player must finish, but that will change.

Code: Show/Hide

if( place != 1 )
else ArenaPlayers*RewardModifier/1

Here, the point distribution is based on how well you did versus the 1st player's finish time. This is probably a better test of race skill (kills, speed, etc ...). If there is a wide gap between 1st place and 50th at say 2 minutes, then the reward will be much lower.

5000/120 = 42 points (rounded to tenths)

You could also make this more intense by multiplying the player's standing by their time or the difference in times:

5000/(120*50) = 1 point (rounded up)

The difference in time would be the better alternative, and may result in a greater gap in point distribution. Although this would penalize everyone.

What do other zone devs think about a reward solution for racing?
i88gerbils - Thu Oct 07, 2004 10:25 am
Post subject:
Probably already know this, but race is broken in 1.3.2 due to changes.

What is different about CommandFunc in cmdman.h that is giving warnings in the following?

Code: Show/Hide

--- asss-1.2.0/src/race.c       2004-08-13 13:43:20.000000000 -0400
+++ asss-1.3.2/src/race.c       2004-10-07 10:11:09.000000000 -0400
@@ -70,9 +70,14 @@
#include <ctype.h> //isdigit()

#include "asss.h"
-#include "region.h" //rect_t
+//#include "region.h" //rect_t
#include "packets/speed.h"

+typedef struct rect_t
+        int x, y, w, h;
+} rect_t; // From old region.h
typedef struct
        u8 completedlaps;
@@ -1097,7 +1102,7 @@
                pdkey = pd->AllocatePlayerData( sizeof(pdata) );
                if (pdkey == -1) return MM_FAIL;

-               cmd->AddCommand("race", Crace, race_help);
+               cmd->AddCommand("race", Crace, ALLARENAS, race_help); // needs arena param in 1.3.x
                mm->RegCallback(CB_ARENAACTION, ArenaAction, ALLARENAS);
                mm->RegCallback(CB_PLAYERACTION, PlayerAction, ALLARENAS);
                net->AddPacket(C2S_POSITION, Pppk);
@@ -1112,7 +1117,7 @@
                mainloop->ClearTimer(timer, NULL);
                mainloop->ClearTimer(countdown_timer, NULL);

-               cmd->RemoveCommand("race", Crace);
+               cmd->RemoveCommand("race", Crace, ALLARENAS); // needs arena param in 1.3.x
                mm->UnregCallback(CB_ARENAACTION, ArenaAction, ALLARENAS);
                mm->UnregCallback(CB_PLAYERACTION, PlayerAction, ALLARENAS);
                net->RemovePacket(C2S_POSITION, Pppk);

Dr Brain - Thu Oct 07, 2004 1:18 pm
Post subject:
void CommandFunc(const char *command, const char *params, Player *p, const Target *target)

This means adding const char *command in most cases.
Smong - Fri Oct 08, 2004 3:44 am
Post subject:
By just looking at the diff it seems ok, I haven't got the facilities to compile or anything as I moved house and forgot my boot disk and blank floppies. But later today I might be able to freeload Visual Studio icon_smile.gif (although possibly it contains .NET icon_sad.gif)
i88gerbils - Fri Oct 22, 2004 1:27 pm
Post subject:
No, the warnings did mean something :P Thanks Dr. Brain. Got back to this problem, and had to change CRace definition besides the changes to AddCommand.

blah. .patch or .diff attachments not allowed. Silly MineGoBOOM.
i88gerbils - Thu Nov 11, 2004 11:45 pm
Post subject: Race 1.3i
Okay. Time to stop bothering Smong with silly race stuff. Here's v1.3i.

This should work. Compiled and tested on my machine. If it doesn't work or you have problems tell me about it.

All documentation should be included in the archive. Prettied things up a little.

Code: Show/Hide
11/05/04        v 1.3i          i88gerbils

        * "i" branch started ;-)
        * RaceReward hack, does not use a separate module.
        * RaceDelay timer added to set maximum race time.
        * AutoRace functionality added to start races automatically.
        * InStartToPlay changed to spec OR ignore non-racers.
        * stats->SendUpdates works.  Now scores will update immediately.  Yay.

Code: Show/Hide
        * RaceMinDelay                                  min=0

          Minimum time needed to passa checkpoint before being disqualified.

        * RaceRewardMode

          Add in a new race reward mode based on time.  This will probably be
          players^2 * RaceReward / rank / (mytime-1sttime) [except for 1st place racer of course!]

SuSE - Fri Nov 12, 2004 12:01 am
Post subject:
7-zip (or p7zip) is your friend
Solo Ace - Fri Nov 12, 2004 2:09 am
Post subject:
i88gerbils - Fri Nov 12, 2004 1:16 pm
Post subject:
Yay saving about 2 seconds of d/l for dialup users...
Dr Brain - Fri Nov 12, 2004 2:08 pm
Post subject:
If you factor in the time it takes to download 7zip, it actually takes longer.
SuSE - Fri Nov 12, 2004 2:18 pm
Post subject:
i88gerbils wrote:
Yay saving about 2 seconds of d/l for dialup users...

I didn't mean it as an insult, yeesh. sa_tongue.gif
Dr Brain wrote:
If you factor in the time it takes to download 7zip, it actually takes longer.

Well, the point isn't just to save download time, but download time and bandwidth and space. Also the bigger the file, obviously the more noticeable the bonus. Besides, you (probably/hopefully) downloaded something to handle .tar & .gz, so there! sa_tongue.gif
Dr Brain - Fri Nov 12, 2004 4:15 pm
Post subject:
We ASSS people work in Linux. "tar zxvf" does the trick for tar.gz.

Of course, in most cases "tar jxvf" will do bz2.
SuSE - Fri Nov 12, 2004 7:12 pm
Post subject: You still had to download something, even if it came with your distro. I wouldn't be surprised if eventually you could do 7z a filename.7z file in some distro without downloading anything extra.
Dr Brain - Fri Nov 12, 2004 8:07 pm
Post subject:
Why do we have to download it if it came with our distro?
SuSE - Fri Nov 12, 2004 10:00 pm
Post subject:
Uh, I s'pose you could buy a CD and have it mailed to you.
D1st0rt - Sun Nov 14, 2004 11:11 pm
Post subject:
or you could just get it through osmosis via the coolant system you installed when you overclocked your processor
SuSE - Sun Nov 14, 2004 11:29 pm
Post subject:
could spawn it through your frontal lobe
Smong - Mon Nov 15, 2004 6:38 am
Post subject:
You know I started this thread? Show some respect.
i88gerbils - Fri Sep 23, 2005 12:29 am
Post subject:
I'm trying to think up the best way to phase out the old region implementation in race & use the Region callback instead.

Is there any good way of dealing with custom-named regions or is it best to just hardcode some check that fails to load the module if there aren't Checkpoint1 - CheckpointX regions? I could make it configureable in the config file, but I'd still need a check anyway.
Smong - Fri Sep 23, 2005 6:49 pm
Post subject:
I think the module should send a mod chat message saying why it failed to attach to an arena. And if you're still using a command to start a race, make the reply text say what's gone wrong.

This module is so old I would just forget it and start again from scratch. I made another race module in py a few months back, just over 100 lines. It's specific to a themed arena though (wipeout).
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group