News:

Herr Otto Partz says you're all nothing but pipsqueaks!

Main Menu

New mod: extended line of sight

Started by HerrNove, January 27, 2025, 01:47:06 AM

Previous topic - Next topic

HerrNove

@Duplode if you can update the IDA database, here are the global names I changed in my code:

byte_3C09C --> detail_threshold_by_level
off_3C084 --> tiles_to_draw_offsets_tables
timertestflag2 --> detail_level
transformed_shape_op_helper2 --> projectiondata9_times_ratio
transformed_shape_op_helper3 --> is_facing_camera
transformed_shape_op_helper --> insert_newest_poly_in_word_40ED6
word_40ED6 --> poly_linked_list_40ED6

HerrNove

Hey, turns out that Plan 3 was easy to implement! This version in attachment is not perfect but seems playable. It tries to draw its 10x11 rectangle of tiles, if there are too many polygons it discards the whole scene and recalculates it with a narrower field. It is horribly inefficient – on a complex ZCT track you'll need a 486 :-) , or crank up your DOSBox cycles – but it is quite playable.

I'll try to devise better methods if I find the time. For now, hope you'll enjoy this version!

HerrNove

And here a small further improvement (better tile prioritization)

Matei

Unlike I tested it the first time, now I tried with other cars and most often it worked. A Pentium 4 at 3.4 GHz is of course not fast enough...

https://github.com/libsdl-org/sdl12-compat/

Btw, I have solved the engine to load any number of tiles (even all of them if you want), no graphical problems at all and it runs well even in the above conditions, but no one is interested... (Cas helped a little)

Duplode

The view from ZCT275's high jump  8)



Quote from: HerrOtto on Yesterday at 12:13:14 PM@Duplode if you can update the IDA database, here are the global names I changed in my code:

Not sure when I'll manage to get back to properly doing Restunts work (I'll try to make some time for that in the upcoming month!), but we'll surely want to keep such notes well-preserved. A cluster of pages in the Wiki could make sense...

HerrNove

#20
This is my latest version, where I tried to do some minimal optimizations. It works well most of the time. Unfortunately, sometimes the tiles near the car still disappear, so it's not really ready for competitive use. I don't know what is the source of the problem but I'm running out of time, so I think this is the best I can do for now.

I investigated the possibility of extending the max # of polygons, but after a long debug session I had to find out that the bugs were due to the exhaustion of the memory (the stack would grow to the point of overwriting the globals – bad things ensued and it cost me a huge amount of time to find out the error). Extending the max polygons would still be possible, I think, if we managed to  allocate a dedicated memory segment for polyinfoptrs. But it would be a huge project and the success would not be guaranteed.

I'll be writing some documentation in the next days, meanwhile I'd appreciate your impressions about whether this version is of your liking.