Re: Breaking the 10-limit : Problems/Questions for Windows build

Mart Kelder <[email protected]>
Newsgroups gmane.games.torcs.devel
Message-ID <[email protected]>
Hi Jean-Philippe (and others),

Op Saturday 05 April 2008 15:37:42 schreef u:
> Hi, Mart and all.
>
> Yes, true. But nowadays, you can't find any C compiler that's not
> a C++ compiler ... So what ? For pure C robots, I'm not sure it's possible.

gcc is a pure C-compiler. Although you can add paramters to it such that it 
compiles C++-programs, it can be used in such way that it is a C-compiler.

The robots are not neccesairy part of Torcs itself. It is possible to organize 
a race between robots, where the contentens write their own robot. If I write 
a robot, I would write it in C++, but I can imagine others wanting to write 
it in C, or another language.

I don't know if other programming languages still work with std::vector.

> No sure to undersand everything. But I also feel there should be other ways
> to select robots and cars for racing. Like monotype races for instance.
> And it should not be very difficult to separate the human driver settings
> (name, controls, level, ...) from the car choice. As for the robots, it's
> another story I guess.

Removing the 10 robot limit doesn't resolve the monotype races problem, 
because the driver list get crowded too fast (3 robots, 3 car types, 10 cars 
of each to race against results in 90 addition items in the driver list, 
which doesn't make them easier to select).

To solve the 10 limit in a C way, I would replace the fixed-size array by a 
pointer, and malloc it to an array with 10 elements. Then, add a function in 
the robottools to change the size of it. Of course, the memory also must be 
free'ed to prevent memory leakage. Also, the size of the array must be stored 
in the tModList structure. This way, existing robots don't have to be 
changed. The biggest disadvantage of this is that you need to free the array, 
and thus is a potential source of memory leakage.

Of course, this only is my opinion.

> Regards,
>
> Jean-Philippe.

Regards,

Mart

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.