home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


Gravity Spheres

by javagamer on 01/04/2009 16:48, 22 messages, last message: 02/01/2009 15:25, 4685 views, last view: 05/03/2024 10:44

Hi,
to better understand the Sauerbraten source code I decided to add a feature that didn't look to hard, but would have some cool results so I made gravity spheres. They are spherical entities which you can place in a map which affect the gravity (including that of grenades and debries) in a spherical radius. In order to place a gravity sphere you just the command /newent gravsphere RADIUS % of gravity. So, if I wanted to make a large sphere with 10% gravity I would type "/newent gravsphere 100 10". Gravity spheres can also overlap, so if you have one which has 200% gravity and one which has 50% gravity the intersection between them has normal gravity.
In order to try them out you can download the patch files from http://www.box.net/shared/hgdztx1ixe . These are patch files, which means you need to apply them to the corresponding source code files, DO NOT replace the files with these patches. Once installed gravity spheres should be completely backwards compatible with regular Sauerbraten and they shouldn't affect regular play.
Right now they run flawlessly on my main Ubuntu 64 computer, but I'm having some trouble on my 32bit Xubuntu laptop (segfaults at the end of loading). I would love some feedback on whether or not they work for you. Enjoy! :)
-Javagamer

Go to first 20 messagesGo to previous 20 messages    Board Index   

#3: ..

by poomon on 01/04/2009 19:17

i'm glad to see more coders getting involved with sau.. cube2.

I noticed a few things with my nitpicking eyes.

1) The patch is generated in reverse direction. i.e. (new -> old)

2) Those patch files can be unified.

3) I think patches adding new features would better be made to SVN head rather than old release version.

I gave it a try against latest svn.
I created two gravspheres and throw grenades into them but nades didnt seem to be affected.
hmm.

Anyway i'm really looking forward to how this patch spices up game play.

reply to this message

#4: Re: ..

by javagamer on 01/04/2009 20:25, refers to #3

I'm really knew to patches so I can get that fixed up in a moment.
Unfortunately Eihrul doesn't think it will make it into the official Sauerbraten release.
I figured more people would have the latest release rather than the SVN, though I could try adding it to the SVN and see how it works.
Also, were you affect by them, and did you try noticable values, b/c 50% isn't a huge difference, try something like 10 or 500. Also, when you hover over the gravity sphere in the editor you should be able to see the radius it will affect.

reply to this message

#5: New Patches

by javagamer on 01/04/2009 20:45

Here are the new patches, when I tried to patch the source directories I ended with a patch file full of all sorts of random data (it messed up the font in my whole terminal) so I figured I must have done something wrong. The new patches are still individual and available at http://www.box.net/shared/r8azb6tgzf .
Continue enjoying :)
-javagamer

reply to this message

#6: how to merge changes

by CCmachine_ubuntu-desktop on 01/12/2009 00:16

how can i "apply" the changes? what software should I use? I've gotten (unmodded) sauerbraten to compile, just trying make, make install in a terminal. I'm currently on Ubuntu Linux 8.04.

reply to this message

#7: Re: how to merge changes

by Hirato Kirata on 01/12/2009 00:22, refers to #6

if you grab the patch, a

patch -p1 -u < patch.diff

should do the trick

reply to this message

#8: Re: how to merge changes

by CCmachine_ubuntu-desktop on 01/12/2009 22:45, refers to #7

Done. patched each file manually, then ran "make clean", "make", "make install" on my 32bit Intel 950 graphics laptop.

Segfault on laptop loading with 1GB ram and intel 950 graphics.

Nvidia graphics and 512mb ram, segfaults on loading too...

both systems are running 32bit although have 64bit CPUs ^.^'

reply to this message

#9: Re: how to merge changes

by Hirato Kirata on 01/13/2009 02:31, refers to #8

open the makefile andreplace the CXXOPTS= line with

CXXOPTS=-ggdb3

and remove any lines wit the word 'strip' in it. then compile it

then type gdb and in the program, type the following

file bin_unix/native_client
run -r -t

when it crashes, type bt to get a backtrace, it'll probably be vague, but it should help javagamer here decipher the reason for it crashing on 32bit

reply to this message

#10: ..

by sbach on 01/18/2009 09:33

Hi, guys
(poor English ...)

Well 1st post, so a BIG thank's to Aardappel, Eihrul & the staff for Sauerbraten.
I'm really impressed how easy mapping can be !

Apart from that i would also like to see this mod working (would be nice javagamer ;).
I tried your second mod (r8azb6tgzf) against the 12/2008 patch (manually), but also got a segfault (xubuntu/32)
(Two function seems to have been modified since the 6/08 but building appear to be ok.
The patch should be correct but I'm also new to this ...)

As suggested by Hirato, i made the change on the makefile, started it in gdb and this was what i got :
... #0 0x080f0287 in loadmodel () ... (more on the attachment (diff & gdb output))
the last package appear to be (on SB screen) : packages/models/checkpoint.

config :
xp2800+/2G, a7n8x(NF2), radeon hd3580(agp) (NO comment ;p), fglrx 8.9

Im not skilled but i could have some time for testing, if needed.
I hope javagamer would smash that bug ;)

Anyway guys, again, thanks to the staff for SB and for give it for free.

diff for 12/08 :
http://www.box.net/shared/pqxt8qt8er

reply to this message

#11: Re: ..

by sbach on 01/18/2009 11:49, refers to #10

well ... ^^
You dev's ... sometime forget there' s some noobs around (like me ;)

Hirato suggested :
" open the makefile and replace the
CXXOPTS= line with
CXXOPTS=-ggdb3"

but in the official 12/08 release there is no "CXXOPTS=" variable in the makefile so i just added it, witch of curse doesn't make any sense (as long she's not called) ^^'

I just tried to add -ggdb3 at the end of the CXXOPTFLAGS var ... witch know looks like :

(CXXOPTFLAGS= -O3 -fomit-frame-pointer -ggdb3),

rebuild, and gdb is more verbose.

Here is the output :
http://www.box.net/shared/yo70mpbf5t

reply to this message

#12: Re: ..

by sbach on 01/18/2009 12:06, refers to #11

ok .. i stop buggin you :/
replaced :
CXXOPTFLAGS= -O3 -fomit-frame-pointer
with :
CXXOPTFLAGS= -ggdb3
http://www.box.net/shared/ng2k3ykxzi
.. sorry

reply to this message

#13: Re: ..

by sbach on 01/18/2009 14:22, refers to #12

well, ... don't know if i should ^^' as apologies ?

but steping with ddd took me to the begginig of entities.h (static const char *entmdlnames[]) and i realized that you added 'gravsphere' elsewhere but not here. So i added it here to ... and ... well ... it seems to works ! :)
radius visible, player/grenades affected ... no crash ... fine ;)

I just added a NULL, were i think it 'should' be, but i don't really know if a str would be better.
I wonder why it hangs on 32 but not on 64 ???

here is where i added it :

fpsgame/entities.h :
@@ -27,7 +27,10 @@ struct entities : icliententities
"health", "boost", "armor/green", "armor/yellow", "quad", "teleporter",
NULL, NULL,
"carrot",
- NULL, NULL,
+// PATCH gravSphere from javagamer {
+// - // NULL, NULL, <<< crash
+/* + */ NULL, NULL, NULL,
+// }
"checkpoint",
NULL, NULL,
NULL, NULL,

hope it helps ;)

the last diff (for 12/08 patch):
http://www.box.net/shared/4mz7kyjfpt

reply to this message

#14: ..

by javagamer on 01/27/2009 01:58

Wow! I didn't realize all the interest this generated. Just checked back and noticed all the posts, so sbach was able to fix it? Nice :D

So how exactly do the NULLs work? I was mostly just playing around with the code and I wasn't quite sure what all those NULLs where for. Thanks again for managing to fix it. :)

Hope everyone enjoys it now.

reply to this message

#15: ..

by sbach on 01/27/2009 20:59

Hi javagamer,

mine ... shame on me ! i was able to find the bug, but not to release a working patch :(

If you tested one of the above, you should have noticed that the game start fine on 32 but that only one gravsphere (the last added) worked :/

While wanted to 'make things better' (adding comment) i made an error and one line was missplaced ...

Now this one was really tested and it really work for me (on 32) as expected.

I use it on a map i'm working on with a big sphere (500 radius at 10% gravity) in the middle of the map and others smaller spheres (64,128 radius at 1000-5000%) and it really works fine, so if there should still some trouble, please drop a line ...

Every-one should also realize that you aren't responsible for my mistake, this mod work, i just didn't test my patch enough.

Well, for the NULL, as far as i know, every variable and pointer have to be declared and initialized. I think this is just a place where theses are initialized and i suppose that on 64 there are some more error check then on 32. I also figure out that it should be a NULL and not an "str" since every str 'declared/initialized' here, appears to be 'interactive' (the player MUST activate it) your gravsphere entity is more 'independent' like lights etc ... (again, like you, i only play with the code and i am not sure about it)

Just another thing : i used ddd (data display debugger an ui for gdb, really useful). Basic stepping (like i did)
isn't that complicated ...

Anyway, thanks for it, I'm right now working on a map especially for it ;)
(but also want to make it playable without ...)

The working patch (i hope at least)
http://www.box.net/shared/lf3fbjmdv0

The map i working on :
http://img292.imageshack.us/img292/592/screenshot4388236gf3.jpg
http://img264.imageshack.us/img264/1219/screenshot4361356ji2.jpg
Let's see how long i have to release it

bye ...

reply to this message

#16: ..

by javagamer on 01/27/2009 23:26

Looks pretty incredible. With a map like that using them they probably stand at least a better chance of getting added officially.
I've yet to test the patch to see if it still works on 64-bit, but sounds like you've got it. I'll be on the IRC for a while if you want to reach me.

reply to this message

#17: ..

by sbach on 01/28/2009 17:38

I also would like to see it added directly in the official release. But i read that the actual focus is not on adding new features but more 'restructuring' some part of the engine, (if i understand it right)

Well, on the other hand ragdoll's look nice but isn't essential in my eyes (svn), again i will prefer lowgrav over it ... but that's my opinion. (No critic here ! I _really_ agree with the rules to keep SB small and efficient, but i also think that some gravity modifier should become, sooner or later, à part of the engine)

About the patch you could first simply add the NULL where i did and maybe then try the patch on a 'vanilla' 12/08 patch [1]

I try to reach you on irc right now, you can also drop me a mail if you want, (just start the subject with 'sauer' or 'gravspere' ;)

reply to this message

#18: ..

by sbach on 01/28/2009 17:41

Oops, forgot the link ... (the patch is for the latest patched official release (12/2008) ...) witch van be found here :

http://sourceforge.net/project/showfiles.php?group_id=102911&release_id=607702&package_id=110363

reply to this message

#19: ..

by javagamer on 01/31/2009 19:14

Still won't work for me :(
Installed the official patch... everything compiled and ran fine. Did patch -p0 <patch.diff from sauerbraten folder. Recompiled and ran... segfault. Like before just before it starts up. :(

reply to this message

#20: ..

by SheeEttin on 01/31/2009 20:54

Doesn't apply cleanly to SVN (as of now, revision 397), but can be manually applied, and it compiles fine.
No segfault for me (32-bit), and the gravspheres work perfectly.

Now if the "magnet boots" were disabled, we could make things like air currents and add a whole new dimension to maps. :)

reply to this message

#21: ..

by javagamer on 02/01/2009 14:34

Still, with the magnet boots it's fun to catch someone in a rocket explosion and watch them tumble away the instant their feet leave the ground :p

reply to this message

#22: ..

by sbach on 02/01/2009 15:25

javgamer :

try with

patch -p0 -u < patch.diff > plog.txt && cat plog.txt

(-R can be used for reversing the sources to its original sate,
)

Here you can grab the 5 files (patched with it) and i also added a readme again (forgot it) [1]

Maybe a request : I came to the idea of using it to 'simulate' simplistic water flow (vertically) but i think for now it can't _subtract_ gravity, maybe latter ?

Example : if i fall 1st trough some 50% sphere an then trough some 10% the falling speed doesn't seems to be affect for the second (of curse the other way around (addition ... 1st 10% and then 1000%) is fine)

SheeEttin:

I don't know how to really use svn, so this patch isn't for it but specifically for the last official version.

[1]
http://www.box.net/shared/72uvz9jub0

reply to this message

Go to first 20 messagesGo to previous 20 messages    Board Index   


Unvalidated accounts can only reply to the 'Permanent Threads' section!


content by Aardappel & eihrul © 2001-2024
website by SleepwalkR © 2001-2024
53870912 visitors requested 71646114 pages
page created in 0.027 seconds using 10 queries
hosted by Boost Digital