Change log file for zeRace
+version 0.6 (2007-02-24)
+ * added some tracks from pyRacerz (thank you Julien)
+ * fixed network initialization issue for Win32
+ * fixed function overflow for Win32
+ * fixed color issue with tires slide
+ * added scripts to easily launch bots
+
version 0.5 (2005-04-16)
* added "formula" track (thank you Julien)
* added some new car sprites (thank you Julien)
all:zeRace server bot_anticip
zeRace:zeRace.c network.h sdl.o car.o tracklist.o $(ICON)
- $(CC) -ansi -Wall -o zeRace$(EXT) zeRace.c sdl.o car.o tracklist.o $(ICON) `$(SDLCONFIG) --cflags --libs` -lSDL_net -lSDL_mixer -lSDL_image -lSDL_gfx -L.
+ $(CC) -o zeRace$(EXT) zeRace.c sdl.o car.o tracklist.o $(ICON) `$(SDLCONFIG) --cflags --libs` -lSDL_net -lSDL_mixer -lSDL_image -lSDL_gfx -L.
server:server.c network.h sdl.o car.o tracklist.o
- $(CC) -ansi -Wall -o server$(EXT) server.c sdl.o car.o tracklist.o `$(SDLCONFIG) --cflags --libs` -lSDL_net -lSDL_image -L.
+ $(CC) -o server$(EXT) server.c sdl.o car.o tracklist.o `$(SDLCONFIG) --cflags --libs` -lSDL_net -lSDL_image -L.
bot_anticip:bot_anticip.c bot.o sdl.o car.o tracklist.o
- $(CC) -ansi -Wall -o bot_anticip$(EXT) bot_anticip.c bot.o sdl.o car.o tracklist.o `$(SDLCONFIG) --cflags --libs` -lSDL_net -lSDL_image -L.
+ $(CC) -o bot_anticip$(EXT) bot_anticip.c bot.o sdl.o car.o tracklist.o `$(SDLCONFIG) --cflags --libs` -lSDL_net -lSDL_image -L.
sdl.o:sdl.c sdl.h
- $(CC) -ansi -Wall -c sdl.c `$(SDLCONFIG) --cflags`
+ $(CC) -c sdl.c `$(SDLCONFIG) --cflags`
car.o:car.c car.h sdl.h
- $(CC) -ansi -Wall -c car.c `$(SDLCONFIG) --cflags`
+ $(CC) -c car.c `$(SDLCONFIG) --cflags`
tracklist.o:tracklist.c tracklist.h
- $(CC) -ansi -Wall -c tracklist.c
+ $(CC) -c tracklist.c
bot.o:bot.c sdl.o car.o tracklist.o
- $(CC) -ansi -Wall -c bot.c `$(SDLCONFIG) --cflags`
+ $(CC) -c bot.c `$(SDLCONFIG) --cflags`
icon.o:icon.rc
$(WINDRES) -i icon.rc -o icon.o
-zeRace 0.5
+zeRace 0.6
site: http://royale.zerezo.com/zerace/
mail: royale@zerezo.com
./bot_anticip localhost 3600 16
Then you can join your own server in zeRace in the "network game" section.
If you are under Windows, replace by "server.exe" and "bot_anticip.exe" in MS-DOS commands.
+You can also use the "local-server-with-bots.*" scripts.
+
+windows:
+Take a look at the files stdout.txt and stderr.txt, they can give useful informations.
+You need to use the task manager if you want to stop the server.
+
+syntax:
+./server 'server_name' nb_laps network_speed (public|private) (col|nocol)
+ server_name : the name of the server
+ nb_laps : the number of laps to complete for each race
+ network_speed : frequency of network messages (1 for fast network, 10 for slow network...)
+ private : this server will not be listed in the 'internet games'
+ col : the server will compute collisions between cars
+./bot_anticip host port random
+ host : host or ip of the server to connect to
+ port : port number of the server to connect to
+ random : frequency of random moves (0 = no random moves, 1 = only random, 1000 = 1/1000 random moves)
s=car->speed/3.3+0.4;
og=120;
}
+ else if (strcmp(trackname,"wave")==0)
+ {
+ a1=150;
+ a2=130;
+ o=1.5;
+ m=0.1;
+ s=car->speed/3.3+0.4;
+ og=120;
+ }
+ else if (strcmp(trackname,"bio")==0)
+ {
+ a1=190;
+ a2=180;
+ o=0.3;
+ m=0.1;
+ s=car->speed/3.3+0.4;
+ og=120;
+ }
+ else if (strcmp(trackname,"city")==0)
+ {
+ a1=150;
+ a2=130;
+ o=1.2;
+ m=0.1;
+ s=car->speed/3.3+0.4;
+ og=120;
+ }
+ else if (strcmp(trackname,"desert")==0)
+ {
+ a1=150;
+ a2=130;
+ o=1.0;
+ m=0.1;
+ s=car->speed/3.3+0.4;
+ og=120;
+ }
+ else if (strcmp(trackname,"http")==0)
+ {
+ a1=190;
+ a2=170;
+ o=1.2;
+ m=0.3;
+ s=car->speed/3.4+0.4;
+ og=240;
+ }
+ else if (strcmp(trackname,"kart")==0)
+ {
+ a1=180;
+ a2=160;
+ o=0.8;
+ m=0.8;
+ s=car->speed/3.3+0.4;
+ og=120;
+ }
/* some default values that may work on some tracks */
else
{
--- /dev/null
+@echo off\r
+echo Launching server...\r
+start server.exe "My private server" 5 1 private col\r
+ping localhost -n 2 > NUL\r
+echo Launching bot(0)...\r
+start bot_anticip.exe localhost 3600 0\r
+ping localhost -n 2 > NUL\r
+echo Launching bot(5)...\r
+start bot_anticip.exe localhost 3600 5\r
+ping localhost -n 2 > NUL\r
+echo Launching bot(10)...\r
+start bot_anticip.exe localhost 3600 10\r
+ping localhost -n 2 > NUL\r
+echo Launching bot(15)...\r
+start bot_anticip.exe localhost 3600 15\r
+ping localhost -n 2 > NUL\r
+echo Launching bot(20)...\r
+start bot_anticip.exe localhost 3600 20\r
+ping localhost -n 2 > NUL\r
+echo A local server has been launched with 5 bots.\r
+echo You can now join it with zeRace in the network menu.\r
+echo When you have finished, you can terminate the server with the task manager.\r
+echo.\r
+pause
\ No newline at end of file
--- /dev/null
+echo 'Launching server...'
+./server "My private server" 5 1 private col &>/dev/null &
+sleep 1
+echo 'Launching bot(0)...'
+./bot_anticip localhost 3600 0 &>/dev/null &
+sleep 1
+echo 'Launching bot(5)...'
+./bot_anticip localhost 3600 5 &>/dev/null &
+sleep 1
+echo 'Launching bot(10)...'
+./bot_anticip localhost 3600 10 &>/dev/null &
+sleep 1
+echo 'Launching bot(15)...'
+./bot_anticip localhost 3600 15 &>/dev/null &
+sleep 1
+echo 'Launching bot(20)...'
+./bot_anticip localhost 3600 20 &>/dev/null &
+sleep 1
+echo A local server has been launched with 5 bots.
+echo You can now join it with zeRace in the network menu.
+echo When you have finished, you can terminate the server.
+echo
\ No newline at end of file
#define MAX_LAG 500
#define MAX_CLIENTS 32
#define PORT "3600"
-#define VERSION "0.5"
+#define VERSION "0.6"
450
655
180
-913
+892
inz
first
435
215
180
-1132
-Royale
+1130
+Julien
hairpins
Hairpins
505
665
0
-2824
-ukero
+2239
+Julien
simple
Simple
678
686
0
-1384
-ukero
+1363
+Julien
+
+bio
+Bio
+Jujucece
+0.1
+930
+500
+270
+1310
+Royale
+
+city
+City
+Jujucece
+0.1
+106
+358
+90
+595
+anonymous
+
+desert
+Desert
+Jujucece
+0.1
+680
+487
+80
+1888
+anonymous
+
+http
+HTTP
+Jujucece
+0.1
+520
+70
+180
+941
+anonymous
+
+kart
+Kart
+Jujucece
+0.1
+370
+725
+0
+2025
+Royale
+
+wave
+Wave
+Jujucece
+0.1
+630
+380
+180
+1860
+anonymous
formula
Formula
350
330
220
-1294
-inz
+790
+FRD
/*
- * zeRace 0.5, a funny retro racing game
+ * zeRace 0.6, a funny retro racing game
* http://royale.zerezo.com/zerace/
*
* Copyright (C) 2004 Antoine Jacquet <royale@zerezo.com>
#define C_RED SDL_MapRGB(screen->format,255,0,0)
#define C_ORANGE SDL_MapRGB(screen->format,255,200,0)
#define C_YELLOW SDL_MapRGB(screen->format,255,255,100)
+#define T_BLACK SDL_MapRGB(cir->format,0,0,0)
/* tracklist */
struct _tracklist *tracklist;
signal(SIGINT,zeRace_exit);
signal(SIGTERM,zeRace_exit);
+ /* initialize SDL */
+ if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO)<0)
+ {
+ fprintf(stderr,"could not initialize SDL : %s\n",SDL_GetError());
+ zeRace_exit();
+ }
+ atexit(SDL_Quit);
+
+ /* initialize SDLNet */
+ if (SDLNet_Init()==-1)
+ {
+ fprintf(stderr,"could not initialize SDLNet : %s\n",SDLNet_GetError());
+ zeRace_exit();
+ }
+
/* read the user configuration file */
zeRace_read_config();
srand(time(NULL));
- if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO)<0)
- {
- fprintf(stderr,"could not initialize SDL : %s\n",SDL_GetError());
- zeRace_exit();
- }
- atexit(SDL_Quit);
-
- if (SDLNet_Init()==-1)
- {
- fprintf(stderr,"could not initialize SDLNet : %s\n",SDLNet_GetError());
- zeRace_exit();
- }
-
packet=SDLNet_AllocPacket(1024);
if (!packet)
{
/* send the best time for this race to the web server */
-void zeRace_send_time(struct _record record)
+void zeRace_send_time(struct _record *record)
{
IPaddress ip;
TCPsocket tcpsock;
int len,result;
/* if the best time is small enought to save all keys, send it */
- if (record.time>=MAXRECORDKEYS) return;
+ if (record->time>=MAXRECORDKEYS) return;
printf("sending time... ");
fflush(stdout);
return;
}
- temp=(char *)malloc(strlen(msg1)+strlen(config.pseudo)+strlen(msg2)+strlen(config.url)+strlen(msg3)+strlen(tracklist->name)+strlen(msg4)+10+strlen(msg5)+10+strlen(msg6)+10+strlen(msg7)+10+strlen(msg8)+10+strlen(msg9)+strlen(record.keys)+100);
- sprintf(temp,"%s%s%s%s%s%s%s%d%s%f%s%f%s%f%s%f%s%s\n",msg1,config.pseudo,msg2,config.url,msg3,tracklist->name,msg4,record.time,msg5,record.x,msg6,record.y,msg7,record.speed,msg8,record.angle,msg9,record.keys);
+ temp=(char *)malloc(strlen(msg1)+strlen(config.pseudo)+strlen(msg2)+strlen(config.url)+strlen(msg3)+strlen(tracklist->name)+strlen(msg4)+10+strlen(msg5)+10+strlen(msg6)+10+strlen(msg7)+10+strlen(msg8)+10+strlen(msg9)+strlen(record->keys)+100);
+ sprintf(temp,"%s%s%s%s%s%s%s%d%s%f%s%f%s%f%s%f%s%s\n",msg1,config.pseudo,msg2,config.url,msg3,tracklist->name,msg4,record->time,msg5,record->x,msg6,record->y,msg7,record->speed,msg8,record->angle,msg9,record->keys);
len=strlen(temp);
result=SDLNet_TCP_Send(tcpsock,temp,len);
SDLNet_UDP_Send(udpsock,-1,packet);
SDL_Flip(screen);
}
- zeRace_send_time(best);
+ zeRace_send_time(&best);
free_mem();
return;
default:
}
else /* end of this network race */
{
- zeRace_send_time(best);
+ zeRace_send_time(&best);
free_mem();
return;
}
/* display tires slide */
if (config.tire)
{
- putpixel(cir,car.x+cos(car.angle)*car.w/3-sin(car.angle)*4,car.y+sin(car.angle)*car.h/3+cos(car.angle)*4,C_BLACK);
- putpixel(cir,car.x+cos(car.angle)*car.w/3+sin(car.angle)*4,car.y+sin(car.angle)*car.h/3-cos(car.angle)*4,C_BLACK);
+ putpixel(cir,car.x+cos(car.angle)*car.w/3-sin(car.angle)*4,car.y+sin(car.angle)*car.h/3+cos(car.angle)*4,T_BLACK);
+ putpixel(cir,car.x+cos(car.angle)*car.w/3+sin(car.angle)*4,car.y+sin(car.angle)*car.h/3-cos(car.angle)*4,T_BLACK);
/* if we are braking the slide is larger */
if (kd)
{
- putpixel(cir,car.x+cos(car.angle)*car.w/3-sin(car.angle)*3,car.y+sin(car.angle)*car.h/3+cos(car.angle)*3,C_BLACK);
- putpixel(cir,car.x+cos(car.angle)*car.w/3+sin(car.angle)*3,car.y+sin(car.angle)*car.h/3-cos(car.angle)*3,C_BLACK);
+ putpixel(cir,car.x+cos(car.angle)*car.w/3-sin(car.angle)*3,car.y+sin(car.angle)*car.h/3+cos(car.angle)*3,T_BLACK);
+ putpixel(cir,car.x+cos(car.angle)*car.w/3+sin(car.angle)*3,car.y+sin(car.angle)*car.h/3-cos(car.angle)*3,T_BLACK);
}
}
}
{
print(screen,WIDTH/2-strlen("Timeout !")*5,HEIGHT/2-10,"Timeout !");
SDL_Flip(screen);
- zeRace_send_time(best);
+ zeRace_send_time(&best);
free_mem();
return;
}