home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


Program code modification

by Slipstream on 10/29/2003 05:30, 24 messages, last message: 11/08/2003 06:47, 4567 views, last view: 05/05/2024 01:37

Programmers interested in using Windows mcisendstring over the FMOD.DLL to play midi and wav files should check this modification out:

http://www.dragonroars.com/source/sound.txt

If you have comments or improvements I'd like to hear them.

And if you want those monsters to jump and die just a bit better...

http://www.dragonroars.com/source/clientextras.txt

You will need to add a Death transistion in your monsters.cpp mine is set to about 450 millseconds.

Last, I do have a question, has Aardappel stopped modification to Cube or is he just busy? I'm not trying to push the subject it has been almost year since the last release. I know I wouldn't have time to work on my project, but this economy has me unemployed. :( I can't complain at least I still have the internet -less food- but it's internet. :)

Go to first 20 messagesGo to previous 20 messages    Board Index   

#5: cube.h includes

by BIAF on 10/31/2003 12:15

hi, In cube.h it includes gl.h and glu.h but there not along with the source, is this normal for thease glide headers not to be included

reply to this message

#6: Slipstream

by pushplay on 10/31/2003 21:00

That's a hell of a lot of work to do when it's possible to recompile sdl with the flag that disables that misfeature.

reply to this message

#7: Re: cube.h includes

by Slipstream on 11/01/2003 05:13, refers to #5

gl.h, glu.h, and glext.h can be downloaded from http://www.opengl.org/
but you might want to check your include directory for them first most compilers include a copy of these. I know if you are using Dev C++ for example they are in include/gl just add them to your linker's library list.

reply to this message

#8: Re: Slipstream

by Slipstream on 11/01/2003 05:24, refers to #6

I am sorry PushPlay but I have not familarized myself with the SDL code (it's not top priority) at this point in time. I did say that it was a "work around" method. And I don't think it's a great deal of work coding, it's just not a straight arrow like it should be. I would be the first to agree that one should go direct to the source. In fact this is one of my reasons for the elimination of FMOD.DLL. To use a dll (free or not) to do something that Windows has in the API is something like asking your best friend to ask a girl for a date. If I get a chance this week I will download the SDL source and take a look.

reply to this message

#9: Re: Slipstream

by pushplay on 11/01/2003 05:54, refers to #8

It's not really a programming thing, it's just that I don't know how to cross-compile object code like that. You don't have to do it for me.

reply to this message

#10: Re: cube.h includes

by BIAF on 11/01/2003 22:35, refers to #7

ta

reply to this message

#11: Re: cube.h includes

by BIAF on 11/01/2003 23:27, refers to #10

after getting gl.h and glu.h, i run compile :

Compiling...
client.cpp
c:\w\cube\cube.h(500) : fatal error C1083: Cannot open include file: 'Gl.h': No such file or directory

i have try'd putting Gl.h in a GL folder also, but decided to put along with other headers and start new workspace on vc++ , then changed cube.h to point to Gl.h not GL/Gl.h etc , still no joy, is the caps case on file name an issue?

reply to this message

#12: no...

by Aardappel_ on 11/02/2003 03:01

just busy

reply to this message

#13: Re: cube.h includes

by Slipstream on 11/02/2003 04:34, refers to #11

BIAF,

It sounds like library issues now. Good news is you are almost there, bad news is your out there and not many people can help you due to how you have it setup. I am using Dev-C++ and I have removed fmod from mine and added libwinmm but here is my library params.

../lib/SDL_main.o -L../lib -lstdc++ -lenet -lSDL -lSDL_image -lz -lopengl32 -lglu32 -lws2_32 "D:\Dev-Cpp\lib\libwinmm.a"

I hope that helps.

reply to this message

#14: Re: cube.h includes

by BIAF on 11/03/2003 05:17, refers to #13

Slipstream ,

Only 2 errors now :

C:\Program Files\Microsoft Visual Studio\VC98\src\worldio.cpp(397) : error C2562: 'loadgamerest' : 'void' function returning a value
c:\program files\microsoft visual studio\vc98\src\cube.h(425) : see declaration of 'loadgamerest'
C:\Program Files\Microsoft Visual Studio\VC98\src\worldio.cpp(410) : error C2562: 'loadgamerest' : 'void' function returning a value
c:\program files\microsoft visual studio\vc98\src\cube.h(425) : see declaration of 'loadgamerest'
Error executing cl.exe

i take it i missed a incluse/file again?

reply to this message

#15: ..

by Slipstream on 11/03/2003 07:24

Hmm, here's the lines as I have them:
cube line 425
extern void loadgamerest();
worldio line 397 & 410 ??
This only appears once on line 395 in mine
void loadgamerest()

Also check this out at the top of that file:

#include "cube.h"

#ifdef WIN32
#define _WINDOWS
#ifndef __GNUC__
#define ZLIB_DLL
#endif
#endif
#include <zlib.h>

Make sure you have zlib.h in the includes that came with cube source.

reply to this message

#16: Re: ..

by BIAF on 11/03/2003 17:40, refers to #15

Slipstream,

Fisrt the lines it complains about are :

Line 397 //

if(gzgeti(f)!=ents.length()) return loadgameout();

&

Line 410 //

if(nmonsters!=monsters.length()) return loadgameout();

Both are in worldio.cpp and under :

void loadgamerest()

Aslo i noticed that your output of :

#include "cube.h"

#ifdef WIN32
#define _WINDOWS
#ifndef __GNUC__
#define ZLIB_DLL
#endif
#endif
#include <zlib.h>

Is different than my worldio.cpp file :

#include "cube.h"

#ifdef WIN32
#define _WINDOWS
#define ZLIB_DLL
#endif
#include <zlib.h>

This above is my layout in that area and is the real source file from zip.

Even tho its not complaining about any other errors or files missing, u think is still could be down to the fact that msvc++ is finding an include file other than the one thats ment to be assigning to, there for leaving me with an include file somewhere thats from msvc install and not the cube source?

reply to this message

#17: death transition...

by D.plomat on 11/03/2003 21:05

I suppose you're talking about death anim frames...

Already done this, was also a 450ms time, and i've made the view fall in the same time for multiplayer (but never tested it in multiplayer) so that a player doesn't respawn while still dying, but i think there must be a more elegant way of doing this (what i've done make a 450ms pause before able to respawn). And i don't know how it'll behave in mp (i think the dead body will disappear as soon as the player respawn). Next i was thinking of using a separate entity for body(with a timeout) and even projected gibs when killed by explosive weapon (declaring the gibs as a non-selectable and non-damaging weapon that is fired just before dying).

Also, as i'm using the same collide function as for landing, sometimes it looks odd (ie baaul killed with only his feets on a platform, and body seems floating in air, or in a wall when anim out of the bounding box.)

Too bad i'm very busy now, i'll try to find some time to just finish what i was doing, adding the trivial changes(plasma gun...) and release the code, but it'll be somewhat unfinished until long time... still, if that permit others reusing some parts of it, :)

reply to this message

#18: ..

by Slipstream on 11/04/2003 08:26

BIAF,

I know the main difference in my source and yours is the compilers. As I stated above mine is Dev C++ with the free compiler gcc and g++ compilers. MSVC++ is much better (more expensive) but better. At this point, I have no idea. Just keep fooling around until it works.

D.plomat,

I am working strictly on SP mode and what you said makes sense. I figured out why the frag count is off in my code, the monster is "technically" alive when dying. This means you can kill a dying monster again in that short 450ms. So if anyone cares to modify my modified code, it shouldn't score until the monster is declared CS_DEAD. My modifed code no longer supports the Cube protocols, so I couldn't play it in MP anyway. I also did away with gibs and I am looking at making bodies fall to ground level, many are floating in the air and stuck in stairs or walls.

To All,

I have friendly AI's (FAI's) now that attack monsters and defend the player. There were a lot of things that caused problems with this mod. First the AI has to keep his distance or they home in on you and block you. Second the FIA needed to look for a nearby monster and kill it. However they had X-Ray vision and could see enemies through the walls! This would cause the FAI to look rather stupid trying to walk through a wall. So now the FAI has a call command assigned to a key to force it to follow player1 and ignore the monster. I might change this later but it works for now. My SP levels are setup to assign you 3 FAI's per level and each has unique abilities. Well that's all for now, I would post some more code on the FAI's but it's a real mess right now and requires much more than 1 file to be modified.

reply to this message

#19: Re: ..

by BIAF on 11/04/2003 14:24, refers to #18

Slipstream

thx m8, u been great help for me to get this far, cheers

reply to this message

#20: Slipstream

by pushplay on 11/04/2003 23:01

The easiest way to get friendly AI would be have a class of monster that chooses enemies out of the closest non-friendly monsters.

Do your FAIs target you if you attack them too often? That would be cool.

reply to this message

#21: ..

by Slipstream on 11/05/2003 07:50

Basically, I have 10 monster types not 8 like Cube. The first 7 (0-6) are nonfriendly and the last 3 (7-9) are friendly. This is done by simple conditions in the monster.cpp to direct them in behavior. The loyalty factor could be lowered which would cause them to attack the player if provoked. Aard put anger vs. loyalty in all the monsters. My FAI's don't attack unless you hit them 100 times which they should be dead long before that. One problem I have is crossfire, I was running from a spider and my fai is toss fireballs at it and hitting me. I have also noticed that the spray weapons (shotgun) tend to hurt more than help. If you are trying to get a monster near a FAI then using the sniper rifle is more precise. "Rocketlaucher bad, rifle good" :)

reply to this message

#22: Re: ..

by D.plomat on 11/05/2003 19:27, refers to #18

In fact, i've added an animspecial property to dynent to handle all animations that have no gameplay value, only visual stuff, so when the monster is dying, he's already CS_DEAD, plus has animspecial=AS_DYING.

I found it the most extensible way, i was planning to add support for taunt/salute animations too, but the drawback is that the protocol won't be compatible even with a source build of original Cube.

For not being compatible with official Cube protocol, even a non modified source won't be because the protocol is different in the source and binary versions.
This is on purpose to avoid any wannabee cheater with programming basics to add an aimbot or the like.

But the source is complete in that you can make a mod with multiplayer, and have your mod clients play MP on your specific servers.

reply to this message

#23: Re: ..

by D.plomat on 11/05/2003 19:30, refers to #21

There is a quick and very efficient but inelegant solution to that, if you just disable friendly fire between you and (or at least only) the FAIs

reply to this message

#24: Doh!

by Slipstream on 11/08/2003 06:47

It never dawned on me to add variables to the dynent! I must really be out to lunch... Well, enough with the coding for now, I've got to get back to making my models and textures for the beta, which should be available soon.

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
53863284 visitors requested 71638396 pages
page created in 0.021 seconds using 10 queries
hosted by Boost Digital