Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Race
Goto page 1, 2  Next
 
Post new topic   Reply to topic Printable version
 View previous topic  <py> elim Post :: Post MySQL module in PY  View next topic  
Author Message
-Smong-
Guest


Offline

PostPosted: Mon Aug 02, 2004 4:19 pm    Post subject: Race Reply to topic Reply with quote

Here is a customisable race module.
sample race.conf wrote:
#define PRIZE_WARP 7
#define PRIZE_THRUST 11
#define PRIZE_SPEED 12
#define PRIZE_FULLCHARGE 13

[Race]
MinPlaying=1
MinTeams=1
Laps=2

; rectangular checkpoint area (top left and bottom right map tile coord)
ChkPt0=507,507,516,516
ChkPt1=549,500,558,509
ChkPt2=527,566,536,575

;whether checkpoint 0 is the start and the finish
ContinuousMap=1

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

; 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-Prize = $PRIZE_SPEED,$PRIZE_SPEED, $PRIZE_THRUST, $PRIZE_THRUST
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-Prize = $PRIZE_WARP, $PRIZE_FULLCHARGE
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).




version 1.2
md5sum incase the forum gets confused over multiple files with the same name
48a3aa5fbfc5d611d648c26912aac116

asss-race.zip - 55.61 KB
File downloaded or viewed 31 time(s)
Back to top
i88gerbils
Oldbie Server Help


Gender:Gender:Male
Joined: Dec 13 2002
Posts: 423
Location: OH
Offline

PostPosted: Mon Aug 02, 2004 9:31 pm    Post subject: Reply to topic Reply with quote

Is there a Changelog from last version? Nevermind. I'll look at it myself :d.

Stay tuned for an editted suggestion list...
_________________
Oldbie Server Help
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website Yahoo Messenger
Bak
?ls -s
0 in


Age:20
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Mon Aug 02, 2004 10:27 pm    Post subject: Reply to topic Reply with quote

good work, although I'd prefer regions to specifing rectangles... not a big deal
Back to top
View users profile Send private message Add User to Ignore List AIM Address
i88gerbils
Oldbie Server Help


Gender:Gender:Male
Joined: Dec 13 2002
Posts: 423
Location: OH
Offline

PostPosted: Mon Aug 09, 2004 6:11 pm    Post subject: Reply to topic Reply with quote

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
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website Yahoo Messenger
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Thu Aug 12, 2004 4:04 pm    Post subject: Reply to topic Reply with quote

AAArgh!!
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
-Smong-
Guest


Offline

PostPosted: Fri Aug 13, 2004 12:43 pm    Post subject: Reply to topic Reply with quote

Hopefully this one will contain the correct source code.



1734afda1e766e962b606f83137ecd5e

asss-race.zip - 56.56 KB
File downloaded or viewed 23 time(s)
Back to top
i88gerbils
Oldbie Server Help


Gender:Gender:Male
Joined: Dec 13 2002
Posts: 423
Location: OH
Offline

PostPosted: Fri Aug 13, 2004 8:36 pm    Post subject: Reply to topic Reply with quote

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...


Last edited by i88gerbils on Fri Aug 20, 2004 2:52 pm, edited 1 time in total
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website Yahoo Messenger
-Smong-
Guest


Offline

PostPosted: Wed Aug 18, 2004 5:04 pm    Post subject: Reply to topic Reply with quote

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).
Back to top
i88gerbils
Oldbie Server Help


Gender:Gender:Male
Joined: Dec 13 2002
Posts: 423
Location: OH
Offline

PostPosted: Fri Aug 20, 2004 6:27 pm    Post subject: Race Reward (__Zone Developer__ Discussion) Reply to topic Reply with quote

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

ArenaPlayers*RewardModifier/Place


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 )
ArenaPlayers*RewardModifier/(1stPlaceTime-Yourtime)
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?
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website Yahoo Messenger
i88gerbils
Oldbie Server Help


Gender:Gender:Male
Joined: Dec 13 2002
Posts: 423
Location: OH
Offline

PostPosted: Thu Oct 07, 2004 10:25 am    Post subject: Reply to topic Reply with quote

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);




race-1.3i.tar.gz - 51.73 KB
File downloaded or viewed 18 time(s)


Last edited by i88gerbils on Mon Nov 22, 2004 7:45 pm, edited 1 time in total
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website Yahoo Messenger
Dr Brain
Flip-flopping like a wind surfer


Age:33
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Thu Oct 07, 2004 1:18 pm    Post subject: Reply to topic Reply with quote

void CommandFunc(const char *command, const char *params, Player *p, const Target *target)

This means adding const char *command in most cases.
_________________
Hyperspace Owner

Smong> so long as 99% deaths feel lame it will always be hyperspace to me
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Fri Oct 08, 2004 3:44 am    Post subject: Reply to topic Reply with quote

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)
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
i88gerbils
Oldbie Server Help


Gender:Gender:Male
Joined: Dec 13 2002
Posts: 423
Location: OH
Offline

PostPosted: Fri Oct 22, 2004 1:27 pm    Post subject: Reply to topic Reply with quote

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.




Okay, this contains a diff from the race in the race directory to the source directory.

I think I got one segmentation fault starting a race, but it did not repeat itself.

race-1.32.patch.txt - 1.86 KB
File downloaded or viewed 21 time(s)
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website Yahoo Messenger
i88gerbils
Oldbie Server Help


Gender:Gender:Male
Joined: Dec 13 2002
Posts: 423
Location: OH
Offline

PostPosted: Thu Nov 11, 2004 11:45 pm    Post subject: Race 1.3i Reply to topic Reply with quote

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
CHANGELOG
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
TODO
        * 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!]
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website Yahoo Messenger
SuSE
Me measures good


Joined: Dec 02 2002
Posts: 2307
Offline

PostPosted: Fri Nov 12, 2004 12:01 am    Post subject: Reply to topic Reply with quote

7-zip (or p7zip) is your friend



7-zip uber owned

race.7z - 41.61 KB
File downloaded or viewed 14 time(s)

bzip2 owned

race.tar.bz2 - 50.8 KB
File downloaded or viewed 16 time(s)


Last edited by SuSE on Fri Nov 12, 2004 2:15 pm, edited 1 time in total
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:32
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Fri Nov 12, 2004 2:09 am    Post subject: Reply to topic Reply with quote

OMG UBER OWNED $$$.
Back to top
View users profile Send private message Add User to Ignore List
i88gerbils
Oldbie Server Help


Gender:Gender:Male
Joined: Dec 13 2002
Posts: 423
Location: OH
Offline

PostPosted: Fri Nov 12, 2004 1:16 pm    Post subject: Reply to topic Reply with quote

Yay saving about 2 seconds of d/l for dialup users...
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website Yahoo Messenger
Dr Brain
Flip-flopping like a wind surfer


Age:33
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Fri Nov 12, 2004 2:08 pm    Post subject: Reply to topic Reply with quote

If you factor in the time it takes to download 7zip, it actually takes longer.
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
SuSE
Me measures good


Joined: Dec 02 2002
Posts: 2307
Offline

PostPosted: Fri Nov 12, 2004 2:18 pm    Post subject: Reply to topic Reply with quote

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
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Dr Brain
Flip-flopping like a wind surfer


Age:33
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Fri Nov 12, 2004 4:15 pm    Post subject: Reply to topic Reply with quote

We ASSS people work in Linux. "tar zxvf" does the trick for tar.gz.

Of course, in most cases "tar jxvf" will do bz2.
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
SuSE
Me measures good


Joined: Dec 02 2002
Posts: 2307
Offline

PostPosted: Fri Nov 12, 2004 7:12 pm    Post subject: Reply to topic Reply with quote

...so? 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.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Dr Brain
Flip-flopping like a wind surfer


Age:33
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Fri Nov 12, 2004 8:07 pm    Post subject: Reply to topic Reply with quote

Why do we have to download it if it came with our distro?
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
SuSE
Me measures good


Joined: Dec 02 2002
Posts: 2307
Offline

PostPosted: Fri Nov 12, 2004 10:00 pm    Post subject: Reply to topic Reply with quote

Uh, I s'pose you could buy a CD and have it mailed to you.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
D1st0rt
Miss Directed Wannabe


Age:31
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Sun Nov 14, 2004 11:11 pm    Post subject: Reply to topic Reply with quote

or you could just get it through osmosis via the coolant system you installed when you overclocked your processor
_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
SuSE
Me measures good


Joined: Dec 02 2002
Posts: 2307
Offline

PostPosted: Sun Nov 14, 2004 11:29 pm    Post subject: Reply to topic Reply with quote

could spawn it through your frontal lobe
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Custom Projects All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 132 page(s) served in previous 5 minutes.

phpBB Created this page in 0.116971 seconds : 51 queries executed (52.3%): GZIP compression disabled