![]() |
![]() |
#1 |
Metallic
|
Loading this model over Sonic, playing in OpenGL with md2s on, playing as Sonic, and switching maps several times will cause the game to slowly break apart.
It usually starts with other character md2's vanishing or missing textures, and progresses to cause all md2s in the game to lose textures, and it can even make it impossible to add files to the game. It might cause further mayhem with enough map loads, netplay, and other variables, but I haven't tested much. Link to the model: https://www.dropbox.com/s/pz7wv1b2dg3k4gr/md2.zip?dl=0 Last edited by Monster Iestyn; 11-05-2016 at 07:21 PM. |
![]() |
![]() |
#2 |
That guy that ports
|
OpenGL in a nutshell is horribly broken and un-optimized. You'd be better off waiting for RedEnchilada, Wofly or another Furyhunter to start working on that renderer before you start using MD2s again.
__________________
Hiyo all! Underground Website |
![]() |
![]() |
#3 |
Friendly Neighbour-Hood
Moderator
|
...make it impossible to add files to the game? What on earth, is there some memory issue or something going on here I wonder?
Also tbh we'd be better off fixing the bug now rather than waiting for an OpenGL remake that may not happen for years yet. This sounds quite a serious one indeed. (Seriously guys stop dismissing OpenGL bugs due to the state of the renderer itself, they're not necessarily impossible to fix contrary to popular opinion =V)
__________________
My page stuffed full of MIDI goodness! The Hitchhiker's Guide to the Robo-Hoodiverse Timeline of Sonic Robo Blast History! That's an uppercase i, not a lowercase L, for the record. Also, it's pronounced "Yes-tin". |
![]() |
![]() |
#4 |
Oh, THAT guy...
|
Well, the model itself isn't setup proper for SRB2. SRB2 has a poly limit of 4048 vertices per model. (this has 6391) This alone is probably the cause of game breaking. I'm also unsure whats going on with the animations? You have 198 blank frame animations, separated out, but all are just the modeled T-posed. Your limited to the same number of frames as the sprites. (1 idle frame, 2 boredom frames, 8 walking frames, 4 spinning frames, 1 springup frame, 4 running frames, 6 ability(super) frames, 1 airbubble frame, 1 taking damaged frame, 1 death frame, 2 falling frames, 1 tailsgrab frame, 1 frame for lifeupbox and 1 for goalsign, in that order for a default character)
__________________
Easy MD2 set-up |
![]() |
![]() |
#5 |
Metallic
|
I wasn't aware of the vertex limit, only the triangle limit. The animations...I, uh, don't know. I didn't actually make any animations for the model and simply loaded it to see if it would...and, well, the results are as posted. Still, though, the game should probably...not load the model or error or something if a model doesn't meet that obscure specification instead of just, well, breaking apart.
|
![]() |
![]() |
#6 |
Friendly Neighbour-Hood
Moderator
|
Actually it's 4096, quickly checking the source code. Most of the MD2 limits are powers of 2, conveniently enough.
But yeah, it is strange the game doesn't check the vertex etc limits against the model's specs at all. Probably should spit out console error messages too or something.
__________________
My page stuffed full of MIDI goodness! The Hitchhiker's Guide to the Robo-Hoodiverse Timeline of Sonic Robo Blast History! That's an uppercase i, not a lowercase L, for the record. Also, it's pronounced "Yes-tin". |
![]() |
![]() |
#7 |
|
I once had this problem before and I can confirm 100% it's the vertices limit. I experienced the same problems and what not, textures acting up, md2s not appearing (and funny enough, my one sonic md2 had his body all normal, but his head, hands, and shoes were missing!) Etc.
Once I quit the game, and fixed to model to be under 5,000 verts (as MI stated 4096), it worked perfectly. I didn't report it back then since I knew it was a mistake on my end because of the vert count. |
![]() |
![]() |
#8 | |
Oh, THAT guy...
|
Quote:
__________________
Easy MD2 set-up |
|
![]() |
![]() |
#9 |
¡Reremy
|
Better to let the models -1500. as well stable performance remains.
Is poorly positioned the model, "lying down". Last edited by XleederTH; 11-04-2016 at 01:55 AM. |
![]() |
![]() |
#10 |
Friendly Neighbour-Hood
Moderator
|
While making a fix for this (that's a link btw) , I've found other MD2s such as Jeck's Sonic (I think it was his?) break other limits such as the one for texture coordinatess with no issue (the Sonic model I was using had something like 12945 texture coords when the max was 4096). Makes me wonder whether the limits need to be upped, or whether the MD2s shouldn't use as much stuff as they do? *shrugs*
Anyway, so you guys know, the "limits" as of 2.1.16 are supposed to be: Code:
#define MD2_MAX_TRIANGLES 8192 #define MD2_MAX_VERTICES 4096 #define MD2_MAX_TEXCOORDS 4096 #define MD2_MAX_FRAMES 512 #define MD2_MAX_SKINS 32 But there we go, it's SRB2's source code. =P
__________________
My page stuffed full of MIDI goodness! The Hitchhiker's Guide to the Robo-Hoodiverse Timeline of Sonic Robo Blast History! That's an uppercase i, not a lowercase L, for the record. Also, it's pronounced "Yes-tin". |
![]() |
![]() |
#11 |
Friendly Neighbour-Hood
Moderator
|
My fix is in now, having too many vertices should now simply make the console spit out an error saying you have too many (and how many maximum are accepted). The number of frames and triangles are also checked btw.
__________________
My page stuffed full of MIDI goodness! The Hitchhiker's Guide to the Robo-Hoodiverse Timeline of Sonic Robo Blast History! That's an uppercase i, not a lowercase L, for the record. Also, it's pronounced "Yes-tin". |
![]() |
![]() |
#12 |
|
You've possibly introduced a new bug, as line 794 is
Code:
md2_models[s].error = false; Code:
md2_models[i].error = false; |
![]() |
![]() |
#13 |
Friendly Neighbour-Hood
Moderator
|
Whoops, well spotted, will fix right away.
EDIT: and the fix has been merged in too now, thanks for spotting that x_x
__________________
My page stuffed full of MIDI goodness! The Hitchhiker's Guide to the Robo-Hoodiverse Timeline of Sonic Robo Blast History! That's an uppercase i, not a lowercase L, for the record. Also, it's pronounced "Yes-tin". Last edited by Monster Iestyn; 11-06-2016 at 05:58 PM. |
![]() |
![]() |
#14 |
¡Reremy
|
Then, I guess the texture's coordinates limits no matter much.
Last edited by XleederTH; 11-12-2016 at 01:43 PM. Reason: correcting grammar (I think xD) |
![]() |