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, 4573 views, last view: 05/16/2024 10:51

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. :)

   Board Index    Go to next 20 messagesGo to last 20 messages

#1: Personally

by pushplay on 10/29/2003 06:28

I'd like to have a version of the SDL object file which didn't redirect stdout to a file. I don't know how to swing something like that myself.

reply to this message

#2: ..

by Slipstream on 10/30/2003 04:22

First,
http://www.dragonroars.com/source/monsters.txt
is now available that shows how to do the M_DEATH transistion but for some reason throws the frag count up higher than actual. I said, "Big deal.".

PushPlay,
So if I am understanding you correctly, the stdout.txt is unwanted? If so, try this work around;

1. Open the stdout in notepad and clear the current text.
2. Save and close
3. Right click->properties
4. General Tab->readonly and hidden checked

Now the file cannot be written to or even seen by most users. This has no effect on game play I just tested it.

Another option would be to add the line "del stdout.txt" to your cube.bat on the last line. This will delete the file as you exit the game. You could do a simular method from the c++ source code by telling the cube program to delete it on quiting the game.
int remove(const char *filename) in <cstdio>
unlink(char*) if you're on a UNIX system.

Windows API is far easier:
DeleteFile("stdout.txt");

You can rename it, move it, write to it etc. without even touching the SDL. Is that what you were talking about or did you want the output going someplace else?



reply to this message

#3: Re: ..

by pushplay on 10/31/2003 03:32, refers to #2

The fact the file was created itself doesn't bother me, but rather that there's no output to the console.

reply to this message

#4: Re: ..

by Slipstream on 10/31/2003 03:51, refers to #3

I guess you would be looking at making a procedure that would check the stdout.txt for changes during game play. The simple quick and dirty method would be:
1. count the lines in the stdout file at startup.
2. recount the lines and compare counts every few seconds.
3. if the count is off read extra lines and display using conoutf
4. make the counts equal

This would have the effect you desire, but might slow the program as your file grows. I would check the file every 15 to 30 seconds.

reply to this message

#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

   Board Index    Go to next 20 messagesGo to last 20 messages


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


content by Aardappel & eihrul © 2001-2024
website by SleepwalkR © 2001-2024
54037504 visitors requested 71817708 pages
page created in 0.025 seconds using 9 queries
hosted by Boost Digital