Baron of Hell
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Source Ports > Attempting to get coding help for my TC's engine
Pages (2): « 1 [2]  
Author
All times are GMT. The time now is 04:38. Post New Thread    Post A Reply
Giomancer
Green Marine


Posts: 45
Registered: 06-02


ZOMG idiot. >.<

Last edited by Giomancer on 06-27-11 at 21:13

Old Post 06-27-11 20:34 #
Giomancer is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
wesleyjohnson
Member


Posts: 486
Registered: 04-09


Just did bobbing code changes in DoomLegacy (no, I am already full time tied up by DoomLegacy). That code is all over the place.
That is because it is not independent of player movement.
Every attempt to fix bobbing resulted in compromises that would affect player movement, so Killough finally came up with the independent player bobbing momentum fields, player->momx and player->momy (which in DoomLegacy are bob_momx, and bob_momy). Anything derived from sources earlier than MBF do not have those fields (only have player->mo->momx, player->mo->momy).

First thing, make a copy of your working directory, and only work in your experimental directory. When you are satisfied with your mods, then do a DIFF against the original that you started with, to create a patch file. Then read that patch file carefully, so you can remove patches that are not part of your fix.

To test an idea use #if 0 ... #endif around that parts that you are cutting out.

Mark your code with comments like
#if 1
// [WDJ] Test of new bobbing code 6/24/2011
..
#else
// [WDJ] Original bobbing code
..
#endif

Grep will find all the uses of most variable uses. It would be better if the authors had not used the same field names in so many structures.
Many times end up using multiple greps.
grep "bob" * | grep "momentum" | less

It would be useful to DIFF against a close relative that has the bobbing the way you want it. But Chocolate Doom may emulate the original behavior but I expect the internal coding is all changed.
That means you have to do the comparisons by eye.

All bobbing is closely tied to changes in player->mo->momx, player->mo->momy.
The orignal updated this in some closely related functions, P_PlayerMove, P_Bob, P_Thrust.

You will see player->momx and player->bob both in one function.
Only change the player->bob (like changing the sign of what is added to it). Changing player->mo->momx and player->mo->momy will affect player movement, with many consequences.

Not having Chocolate Doom source, I can only guess whether it keeps the original names, or has new functions, and new structure.
DoomLegacy has changed many of its function names too (to make grep more useful if nothing else).

Beware of adding anything to info.c structures, they are indexed by other definitions made in other files. Only add to the end of a structure, and then you will have to also create definition names to index the new entries. See how any advanced port added Heretic to the original Doom info.c entries.

I do not remember anything about "0.4 alpha bobbing", do not know what it is.

Last edited by wesleyjohnson on 06-27-11 at 22:21

Old Post 06-27-11 21:59 #
wesleyjohnson is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Whoo
Forum Regular


Posts: 673
Registered: 04-07


Here is a modified choco executable that has the alpha's bobbing behavior:

http://www.speedyshare.com/files/29...colate-doom.exe

I changed psp->sy = WEAPONTOP + FixedMul (player->bob, finesine[angle]); to psp->sy = WEAPONTOP - FixedMul (player->bob, finesine[angle]); in order to invert the vertical angle of the bob.

Be noted however that the bottoms of the sprites (the flat cutoff point) will be visible unless you make them vertically longer than usual. The chaingun, rocket launcher, and bfg for example are all vertically longer than the other weapon sprites meaning that the bottoms of them will stay off-screen.

I'll mess around with the source later to implement the other bob related things you wanted.

Last edited by Whoo on 06-28-11 at 17:30

Old Post 06-28-11 03:10 #
Whoo is online now Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
wesleyjohnson
Member


Posts: 486
Registered: 04-09


Won't be able to see what the changes are from an executable, and exe format assumes MSWindows.
Can you make that a patch or other diff file.

Old Post 06-28-11 21:38 #
wesleyjohnson is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Whoo
Forum Regular


Posts: 673
Registered: 04-07



wesleyjohnson said:
Won't be able to see what the changes are from an executable, and exe format assumes MSWindows.
Can you make that a patch or other diff file.



Here is the modified version of p_pspr.c that changes the bob:

http://pastebin.com/WG4CEs6e

Old Post 06-28-11 21:53 #
Whoo is online now Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Giomancer
Green Marine


Posts: 45
Registered: 06-02


Hey Sodaholic, any luck finding someone to give you a hand with your engine?

Old Post 07-16-11 01:16 #
Giomancer is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 04:38. Post New Thread    Post A Reply
Pages (2): « 1 [2]  
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Source Ports > Attempting to get coding help for my TC's engine

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Forums Directory