Rendering in U7

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
SomeDude

Rendering in U7

Post by SomeDude »

Hello, i'm myself a curious programmer, and just wondered about how is rendering in exult done.
SomeDude

Re: Rendering in U7

Post by SomeDude »

And by rendering i mean map rendering, every item and npc in the world.
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Rendering in U7

Post by drcode »

The code is in gamerend.cc, I believe. First we render the flat tiles, then the various objects using a complicated algorithm that nobody understands.:-)
SomeDude

Re: Rendering in U7

Post by SomeDude »

Wow, thanks for the hints. Reading it now.
Colourless
Site Admin
Posts: 731
Joined: Thu May 14, 2020 1:34 pm

Re: Rendering in U7

Post by Colourless »

The most peculiar thing about how Exult renderers is all the objects are sorted as they are added into their 'chunk'. Exult doesn't do sorting when doing actual rendering. (Note I haven't checked the code in years, it may have changed, but I doubt it)
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Rendering in U7

Post by Dominus »

funnily, thanks to Dale, I found a strange render bug.
When you place an object on an egg the object will get the same coordinates as the egg (x,y,z). Unfortunately if there is already an object in that spot with exact the same coordinates, the new placed object is sorted *beneath* the old object...
http://sourceforge.net/tracker/?func=de ... tid=102335
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Rendering in U7

Post by drcode »

Yes, we pre-sort everything. I thought it would be too slow to do it during rendering.

What makes it so hard is that many objects occupy the same space, like paintings on walls.
SomeDude

Re: Rendering in U7

Post by SomeDude »

But at some time npcs will walk, so there must be more sortings mechanisms. Not counting with projectiles. Am i wrong?
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Rendering in U7

Post by drcode »

At each frame, the NPC is removed from the list and then added back at the new spot.
SomeDude

Re: Rendering in U7

Post by SomeDude »

Ah, i see. Thanks for your explanations :D
Locked