Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : Development : Linux DROD
12
Page 3 of 4
4
New Topic New Poll Post Reply
Poster Message
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5460
Registered: 02-04-2003
IP: Logged
icon Re: Linux DROD (0)  
The (WCHAR*).value thing doesn't work quite right, so I added:

#define pWCv(x) (x)->value

to handle that case. Now that BackEndLib is in place, I'll finish up with the other 3 projects and commit everything when done.
07-10-2003 at 03:37 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5460
Registered: 02-04-2003
IP: Logged
icon Re: Linux DROD (0)  
Ok, it's all checked in. Take a look at how I improvised WChar.h and CharTraits.h and if it's not quite right feel free to send me another patch with your changes.
07-10-2003 at 04:55 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged

File: DROD-2003-07.13.patch (9.3 KB)
Downloaded 122 times.
License: Other
From: Unspecified
icon Re: Linux DROD (0)  
mrimer wrote:
I don't understand -- why when we return a reference with & is it read-only? It's not just returning a copy of the data or anything...is it?
It seems to be returning a copy in the case of char_traits, yes. I don't know why, but that's how it is.

Ok, it's all checked in. Take a look at how I improvised WChar.h and CharTraits.h and if it's not quite right feel free to send me another patch with your changes.
Looks good! :) . The reason i didn't put those operators in CharTraits.h, is that the contents of that file will be part of listdc++ soon-ish, so that we can include that file in stead and put CharTraits.h in the attic - but i don't know how soon that will happen, and we might as well just include the libstdc++ version in CharTraits.h as including it in Wchar.h when it happens, so it's not really a problem.

Anyway, i found a few small things to fix (mostly leftovers), in the attached patch (one patch for all subdirs).

Oh, and i completed Dugan's Dungeon at friday, by the way. Loved the ending :D


[Edited by trick on 07-13-2003 at 03:03 PM GMT: removed bug info - it was wrong (stupid error on my part)]
07-13-2003 at 02:22 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5460
Registered: 02-04-2003
IP: Logged
icon Re: Linux DROD (0)  
I inserted all the changes you made and will commit them just as soon as SF starts behaving. ...so, can you play it under linux yet? (What linux distro are you using?)

Congratulations on finishing DD! :P


[Edited by mrimer on 07-14-2003 at 04:47 PM]
07-14-2003 at 04:45 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged
icon Re: Re: Linux DROD (0)  
mrimer wrote:
I inserted all the changes you made and will commit them just as soon as SF starts behaving. ...so, can you play it under linux yet?
Not yet, no. It still has that crash-on-gamestart (continue/demo/build) bug, as i haven't had the time to look at it yet. I'll see what i can find out tomorrow - I'd do it today, but i'm too tired after a day at the beach :P (whaaat, i choose the beach over hacking at DROD ? Yep, it was just too hot to stay inside today.. i need a portable computer ;))

Anyway, it throws an assertion in DbPackedVars line 357 (ASSERT(wVarNameSize < 256)), where wVarNameSize suddenly is 4260228352 (after having read a 0, 237, 237 and 253 into it). Should it abort on the first zero ? Anyway, as i said, i'll look deeper into it tomorrow.

(What linux distro are you using?)
I'm using Gentoo Linux. Great distro, but a bit time-consuming to upgrade at an aging computer like mine (it's just 500mhz, gasp) as it compiles everything.. Still, i like being able to make things the way i want :P . I've tried many other distros, and so far this is my favorite. (It's not for newbies, tho.)

Congratulations on finishing DD! :P
Thank you! :D

- Gerry

07-14-2003 at 08:20 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged

File: DROD-DynCast.patch (23.8 KB)
Downloaded 127 times.
License: Other
From: Unspecified
icon Re: Linux DROD (0)  
I tracked down another bug today (somewhat), when trying to edit a new room in a freshly created hold and level (it's not related to the start-game problems, still working on that). The dynamic cast in EditSelectScreen.cpp line 537 (after the attached patch) fails and returns NULL, which causes pEditRoomScreen->SetRoom to be called with this = NULL, and this again results in a segmentation fault when it tries to dereference that. This wouldn't be caught in windows as it doesn't protect its memory very well, tho if this fails in windows as well i'm pretty sure it would wreak havoc all over the place, so i don't think that's the case. Still, could you check ?

The attached patch fixes a bug in two of the makefiles (extra space at end of line), and adds a DYN_CAST macro, a DynCastAssert template function, and changes all dynamic_cast's to use DYN_CAST. That will catch all cast failures in the future. The DynCastAssert function only catches failed casts where the pointer was not already zero, so there shouldn't be any problems (for this reason i left in any ASSERTs below dynamic_cast's if there were any). I tried to make it as simple to use as possible - let me know if there's any problems.

By the way, i'm pretty sure those makefiles didn't have that bug when i sent the last patch - do you enter all patches manually ?

- Gerry

07-15-2003 at 04:23 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2810
Registered: 02-04-2003
IP: Logged
icon Re: Re: Linux DROD (0)  
trick wrote:
I tracked down another bug today (somewhat), when trying to edit a new room in a freshly created hold and level (it's not related to the start-game problems, still working on that). The dynamic cast in EditSelectScreen.cpp line 537 (after the attached patch) fails and returns NULL, which causes pEditRoomScreen->SetRoom to be called with this = NULL, and this again results in a segmentation fault when it tries to dereference that.
Is GetLoadedScreen() returning non-NULL?
This wouldn't be caught in windows as it doesn't protect its memory very well, tho if this fails in windows as well i'm pretty sure it would wreak havoc all over the place, so i don't think that's the case. Still, could you check ?
This would give a system error in Windows too.
The attached patch fixes a bug in two of the makefiles (extra space at end of line), and adds a DYN_CAST macro, a DynCastAssert template function, and changes all dynamic_cast's to use DYN_CAST. That will catch all cast failures in the future.
This sounds okay.

-Gerry

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
Decent Apps - open source tools for writing and deploying privacy-focused LLM-based web apps.
07-15-2003 at 05:12 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged
icon Re: Re: Re: Linux DROD (0)  
ErikH2000 wrote:
Is GetLoadedScreen() returning non-NULL?
Yes. I've traced the call, and everything in GetLoadedScreen succeeds. It returns a valid pointer to CScreen, that doesn't seem to have any problems in it. Then this pointer somehow fails the cast to CEditRoomScreen*. I made a little test prog that tested the dynamic cast behaviour, and it seems to be working ok, so i'm pretty sure it's not a bug in the compiler (and, in that case, others would have found it too). That can only mean that the pointer is not CEditRoomScreen (or castable to it) when first stored in the ScreenManager - I'll look deeper into it.

This would give a system error in Windows too.
Probably, but i do know windows is more forgiving of accessing restricted memory.

-Gerry
Hm :)

- Gerry

07-15-2003 at 05:41 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5526
Registered: 02-04-2003
IP: Logged
icon Re: Re: Re: Re: Linux DROD (0)  
trick wrote:
Probably, but i do know windows is more forgiving of accessing restricted memory.
In the Windows 95 family, yes, but in NT-based OSes (NT, 2000, XP) it acts a lot like Linux. It won't dump a core, but will crash the program, allowing you to debug it if there's debugging information in the executable. As opposed to 95/98 etc., under which such bugs will often just crash the machine.


____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
07-15-2003 at 09:29 PM
View Profile Send Private Message to User Show all user's posts High Scores Quote Reply
trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged
icon Re: Re: Re: Re: Re: Linux DROD (0)  
Schik wrote:
In the Windows 95 family, yes, but in NT-based OSes (NT, 2000, XP) it acts a lot like Linux. It won't dump a core, but will crash the program, allowing you to debug it if there's debugging information in the executable. As opposed to 95/98 etc., under which such bugs will often just crash the machine.
Ah, that's great. It means i was wrong again, tho, for the third time in just a few hours on the DROD board alone. I should probably shut up for some time.

- Gerry

07-15-2003 at 09:35 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5526
Registered: 02-04-2003
IP: Logged
icon Re: Linux DROD (0)  
I'm pretty sure that Linux has lots of ketchup and puppies.

(just trying to make you feel better :))

This reminds me of some advice Erik gave me a while back:
http://www.drod.net/forum/viewtopic.php?TopicID=69&page=0#363

[Edited by Schik on 07-15-2003 at 09:38 PM]

____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
07-15-2003 at 09:36 PM
View Profile Send Private Message to User Show all user's posts High Scores Quote Reply
trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged
icon Re: Re: Linux DROD (0)  
Schik wrote:
I'm pretty sure that Linux has lots of ketchup and puppies.
Sure it does! And penguins! Lots and lots and lots of cute, cuddly penguins.

(just trying to make you feel better :))
Thank you!

This reminds me of some advice Erik gave me a while back:
http://www.drod.net/forum/viewtopic.php?TopicID=69&page=0#363
Thanks again. I feel better now, unless i'm mistaken :D

- Gerry

07-15-2003 at 09:48 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5460
Registered: 02-04-2003
IP: Logged
icon Re: Re: Linux DROD (0)  
trick wrote:
By the way, i'm pretty sure those makefiles didn't have that bug when i sent the last patch - do you enter all patches manually ?
Urghh...sorry about that, unless I'm mistaken. :) I've put in and committed all the dynamic cast macro changes. Um...is there an easier way to enter in diffs than copy-and-paste?

[Edited by mrimer on 07-16-2003 at 09:07 AM]
07-16-2003 at 08:29 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5460
Registered: 02-04-2003
IP: Logged
icon Re: Re: Re: Re: Linux DROD (0)  
trick wrote:
I've traced the call, and everything in GetLoadedScreen succeeds. It returns a valid pointer to CScreen, that doesn't seem to have any problems in it. Then this pointer somehow fails the cast to CEditRoomScreen*.
The various room screens are derived through several classes from their upper-most base class (CWidget). EditRoomScreen and GameScreen are both derived from RoomScreen, which is derived from DrodScreen. You can check out the class definitions there and see whether I'm doing anything dodgy. (It looks fine to me, but there's always that C++ nuance that shoots you in the foot...) Does it matter that they're inheriting protected instead of public? Or that they don't have any explicit destructors declared (virtual or otherwise)? You never know...at least I don't :D
07-16-2003 at 09:14 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5526
Registered: 02-04-2003
IP: Logged
icon Re: Re: Re: Linux DROD (0)  
mrimer wrote:
Um...is there an easier way to enter in diffs than copy-and-paste?
Eew. Use 'patch'. I applied his latest patch with just "patch < filename.patch", unless I'm mistaken.

I use patch from cygwin, although I'm sure you could find others. The only thing you might need to worry about is trick's patches have unixy newlines, which my patch doesn't like (although I think that's a setting I chose when I installed cygwin), so you need to convert it - there's a unix2dos in cygwin as well.

____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
07-16-2003 at 12:45 PM
View Profile Send Private Message to User Show all user's posts High Scores Quote Reply
trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged

File: DROD-PublicInheritance.patch (1.7 KB)
Downloaded 113 times.
License: Other
From: Unspecified
icon Re: Re: Re: Re: Re: Linux DROD (0)  
mrimer wrote:
The various room screens are derived through several classes from their upper-most base class (CWidget). EditRoomScreen and GameScreen are both derived from RoomScreen, which is derived from DrodScreen. You can check out the class definitions there and see whether I'm doing anything dodgy. (It looks fine to me, but there's always that C++ nuance that shoots you in the foot...) Does it matter that they're inheriting protected instead of public? Or that they don't have any explicit destructors declared (virtual or otherwise)? You never know...at least I don't :D
It seems it mattered that the classes inherited protected instead of public. With the inherits public in stead of private, i can now actually edit new levels and even playtest them! I made a little room with all the objects in it, and everything seems to be working properly.

Anyway, i didn't know that protected inheritance affected dynamic casting. I did a little googling (protected dynamic_cast), and the only results had to do with bugs in g++. It may be a bug in the compiler, but it may not - assuming a bug lies in the compiler is usually wrong, but then again, not always..

In any case, the attached patch changes those three classes to inherit public instead, for now (it doesn't change anything else). I hope it doesn't introduce any other problems. With this out of the way, the only thing keeping DROD from running properly in linux (apart from the read-only/writable data split, but i'll take care of that when all nasty bugs are gone) is the bug that causes drod to crash at continue/demo. Yay! :D

Urghh...sorry about that, unless I'm mistaken. :) I've put in and committed all the dynamic cast macro changes. Um...is there an easier way to enter in diffs than copy-and-paste?
Ugh! Like Schik said, use patch from cygwin. I did some detective work for ya :) and discovered that the only patch for windows that i can find is in fact the one distributed with cygwin. There's a whole bunch of diff programs and diff viewers, but no patchers that i could find. Weird. In any case, you should be able to get patch by installing cygwin, but bypassing that setup program and just get the latest patch.exe and the cygwin dll from a mirror should work too, if you don't want to install all of cygwin.

Schik wrote:
I use patch from cygwin, although I'm sure you could find others. The only thing you might need to worry about is trick's patches have unixy newlines, which my patch doesn't like (although I think that's a setting I chose when I installed cygwin), so you need to convert it - there's a unix2dos in cygwin as well.
Oh. I've got the unix2dos proggie too, so no worries - I'll just run the patches through that one from now on :)

- Gerry

07-16-2003 at 11:07 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5460
Registered: 02-04-2003
IP: Logged
icon Re: Re: Re: Re: Re: Re: Linux DROD (0)  
trick wrote:
It seems it mattered that the classes inherited protected instead of public.
We looked this up in the C++ standard, and it says dynamic_cast of an inaccessable derived class should fail. In other words, inheriting in some way other than public is used to shield "outside code" from knowing that this class has been derived from its base class. I think MSVS has been lenient and not conformed to the C++ standard here (isn't that a surprise). We might look for any other class being inherited as protected/private (if you haven't already).
07-17-2003 at 12:06 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged

File: editor-linux1.png (88.3 KB)
Downloaded 117 times.
License: Other
From: Unspecified
icon Re: Re: Re: Re: Re: Re: Re: Linux DROD (0)  
mrimer wrote:
We looked this up in the C++ standard, and it says dynamic_cast of an inaccessable derived class should fail. In other words, inheriting in some way other than public is used to shield "outside code" from knowing that this class has been derived from its base class. I think MSVS has been lenient and not conformed to the C++ standard here (isn't that a surprise). We might look for any other class being inherited as protected/private (if you haven't already).
It depends on what "inaccessible" means, i guess - i've a prog here that dynamic_cast's protected inherited classes with success in newer versions of gcc/g++ after a bug-fix (and i assume the gcc guys know what they're doing), so it seems to be allowed in some situations. The question is: what are those situations ? I'd like to know, but for DROD it's not important if the public inheritance isn't a big problem, of course.

Anyway, after that DYN_CAST patch, we don't have to look for this. It comes looking for us - at least in linux. There's no need to make all inheritances public if it isn't required - there's a reason they're protected to begin with, right ? Of course, making all inheritances public would catch all untested cases of this problem as well. What do you think ?

Oh, and i attached a screenshot of the editor in action in linux (it looks just like windows, except the window decorations :P). The room in the pic is based on a basic idea i have in mind for a hold, but most parts isn't part of it - i added a whole lot of things for testing purposes - so don't take this as an example of my level creations :P

- Gerry

07-17-2003 at 12:59 AM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged
icon Re: Linux DROD (0)  
For your information.. It runs! It plays! It just doesn't play Dugans Dungeon - any other hold seems to work, but DD causes the crash. I'm using the data files fresh from CVS, so i assume those are okay.. I'll let you know when i know more.

07-17-2003 at 01:44 AM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5460
Registered: 02-04-2003
IP: Logged
icon Re: Re: Re: Re: Re: Re: Re: Re: Linux DROD (0)  
trick wrote:
It depends on what "inaccessible" means
It means you can't access it, you know, just like you can't access a non-public member variable from outside the object.
There's no need to make all inheritances public if it isn't required - there's a reason they're protected to begin with, right ? Of course, making all inheritances public would catch all untested cases of this problem as well. What do you think ?
Umm...no, there's no good reason the screens inherit protected base classes. I'm switching them all to public inheritances.

(That looks like a wild level you're building there! Don't forget to back the files up every so often, just in case!)
07-17-2003 at 02:51 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged
icon Re: Re: Re: Re: Re: Re: Re: Re: Re: Linux DROD (0)  
mrimer wrote:
trick wrote:
It depends on what "inaccessible" means
It means you can't access it, you know, just like you can't access a non-public member variable from outside the object.
Yes, but what i meant was, what parts ? Since dynamic_cast seems to be valid for some protected <-> public casts, but not others ? Or is the fact that g++ allows some of those a bug ?

In any case, it doesn't matter to DROD anymore.

Umm...no, there's no good reason the screens inherit protected base classes. I'm switching them all to public inheritances.
Oh, okay. No problems then.

(That looks like a wild level you're building there! Don't forget to back the files up every so often, just in case!)
Well, thanks, but i already lost it while being a little careless a few minutes ago. Doesn't matter, tho, since it was just a test-thing, and just one room. As i said, i just threw in a whole bunch of stuff to test it. I'll still use the basic idea of the room (the layout, the broken floor), but the monsters will be different in the real version.

- Gerry

07-17-2003 at 03:11 AM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged
icon Re: Linux DROD (0)  
Thought i'd give y'all a status update.

First, there's still some crash-bugs i'm having some problems tracking down:

* While pressing continue with Dugan's Dungeon selected, DbPackedVars.cpp line 357 fails twice, before DROD segfaults (happens with clean data straight from CVS). All other holds i've tried works fine. It doesn't seem to be directly related to the number of rooms or monsters, as i tried creating a test hold with 25 levels of 25 rooms each (with 24 rooms in each level completely filled with roaches), and that works (tho it gobbed up 64 mb ram when copying the levels, but only 31 mb after exit + edit/play. Copying the entire hold slowly increase the ram use to 67 mb as it copies. Looks like a memory leak, i'll look into that later). I did get it to crash once, after editing some at the first level (it started in once east), and after the crash the style of the first level was changed from Cavern to Palace. I didn't have the debugger running, and haven't got that to happen again :(

* While exporting any hold, DbPackedVars.cpp line 357 fails (again twice) and segfaults.

I'm thinking these two are related, as they both have the same symptoms, and this is true for both:

* While entering CDbPackedVars::UnpackBuffer, pBuf points to what looks like garbage to me. When pRead is used in line 379, it segfaults (since wVarNameSize, which is several millions, is added to pRead before this).

* The call to the failing UnpackBuffer always originates in CDbRoom::LoadMonsters, DbRoom.cpp line 2033, when it assigns ExtraVars to a new monster, with wMonsterI = 0.

It may be that the solution is obvious and i've just missed it so far. The last week or so has been incredibly hot (above 30 in the shadows! in norway!), and that makes it kinda difficult to think clearly when i'm inside (at least for us that's not used to such temperatures - been outside a lot, obviously).

In any case, i have a small break from those problems right now to get a fresh perspective when i come back and address some other stuff that needs doing before the linux version is ready to go. Right now i'm adding the data/resource path seperation code, and have a question about that:

Since the data and resource paths may differ, should i put both paths in DataPath.txt, or should the path in DataPath.txt be made to point to the resources in stead ? Since DataPath.txt needs to be writable by DROD it'll be put together with the other writable data in linux, so where DataPath.txt is, the .dat files is (well, in a subdir, anyway). There's also the problem on how to locate the resource dir - just pick a random filename works, but the names aren't exactly unique. In linux the data (and res) path would probably be compiled-in (with some alternatives) - windows could just set the dat and res paths to be the same, maybe ?

There's also an error showing up at Mike and Adam's linux boxes while first trying to render a string with SDL_ttf - but i don't get that error here. I think it's due to incompabilities in either SDL_ttf or freetype - freetype 2.1.3 is known to have problems with SDL_ttf.

- Gerry

07-19-2003 at 04:54 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5460
Registered: 02-04-2003
IP: Logged
icon Re: Re: Re: Linux DROD (0)  
trick wrote:
Anyway, it throws an assertion in DbPackedVars line 357 (ASSERT(wVarNameSize < 256)), where wVarNameSize suddenly is 4260228352 (after having read a 0, 237, 237 and 253 into it).
This looks like possibly our two versions of Metakit aren't doing the same thing. It should have at least four consecutive 0's in this buffer for each monster (since currently there is no monster with any extra vars, so that value is always UINT 0). But you're saying it works on any other data that is created locally. I'm wondering whether DD would work if you generated your own .dat files from scratch using DRODUtil.

[Edited by mrimer on 07-19-2003 at 06:06 PM]
07-19-2003 at 05:59 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged

File: Caravel-2003-07-22.zip (130.2 KB)
Downloaded 114 times.
License: Other
From: Unspecified
icon Re: Re: Re: Re: Linux DROD (0)  
mrimer wrote:
This looks like possibly our two versions of Metakit aren't doing the same thing. It should have at least four consecutive 0's in this buffer for each monster (since currently there is no monster with any extra vars, so that value is always UINT 0). But you're saying it works on any other data that is created locally. I'm wondering whether DD would work if you generated your own .dat files from scratch using DRODUtil.
That could be the reason, tho i'm using the exact same version as Erik said he uses, the Metakit website doesn't mention any linux/windows platform incompabilities, and the same symptoms shows up when exporting any hold - so unless DD is accessed during exporting, the fault is elsewhere. I'll try creating my own dat file, tho, just to check. I'll get to porting DRODUtil soon (the heat around here has lessened somewhat now, btw, replaced by random wild thunderstorms. Yay).

Attached a patch that fixes a bug with random numbers in linux (i noticed all the blood always flew in the same direction while playtesting some). The cause for this is that the 32-bit unsigned integer overflowed when being multiplied, so i put in some unsigned long long casts in the definition (if that causes a problem, casting to float works as well). I also moved the RAND define to Types.h so it can be used in FrontEndLib/Bolt.cpp as well (and changed Bolt.cpp to use it), but that might not be the best place for it, so feel free to move it around :P .

Also, i got the official char traits header from the libstdc++ cvs (with permission :)) and put it in BackEndLib (pod_char_traits.h, in the zip), removed most things from CharTraits.h, and made it include that file. That way we can easily change it to include <ext/pod_char_traits.h> in stead when it is in a stable libstdc++ release. I also ripped out the license part from CharTraits.h, since i'm a bit unsure what to put it under - the libstdc++ version of the GPL, since it adds some things to the pod_char_traits definitions, or the MPL, like the rest ? Entirely up to you guys (the pod_char_traits.h license has to stay as it is, of course, but that shouldn't be a problem because of its exception).

I also fixed some filename cases in Data/drod.ini, and added an Ogg Vorbis version of AlanComplete to Data/Sounds (in the zip). I used quality 4 when encoding (= 128kbps +/-, roughly equivalent to mp3 at 160kbps). It doesn't add any noticable pauses when playing at my system. I can't hear any difference between this and the wav, but i've got really crappy speakers, so if anyone complains, let me know and i'll encode it at a higher quality. ADPCM probably killed it already, tho :P

I have a bunch of other stuff that's not included in the patch (dat/res stuff), since it currently breaks things. Expect another patch soon.

Oh, one more thing. I'm going away on vacation for a week on monday (sorry for not mentioning this before..). I hope i can get this thing running properly before the end of this week, but if not, i won't be able to tinker with it until i'm back. Since you're pretty close to a stable windows release now i guess that means the linux release won't be released simultaneously (how's the mac port going, btw ?) , but if that happens i hope there won't be a problem creating a branch in CVS to finish the linux release (without adding anything new, of course).

- Gerry

07-22-2003 at 07:43 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5460
Registered: 02-04-2003
IP: Logged
icon Re: Linux DROD (0)  
I just changed all the reinterpret_casts to either static_casts, for primitive data types, or dynamic_casts (DYN_CAST) for class casts. I'm wondering whether this might cause anything to run more smoothly on Linux.
07-22-2003 at 08:03 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5460
Registered: 02-04-2003
IP: Logged
icon Re: Linux DROD (0)  
It's all checked in! Get it while it's hot! (Had to tweak the ULONGLONG def a bit for Windows.)
07-22-2003 at 08:50 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2810
Registered: 02-04-2003
IP: Logged
icon Re: Re: Linux DROD (0)  
mrimer wrote:
It's all checked in! Get it while it's hot! (Had to tweak the ULONGLONG def a bit for Windows.)
I don't know what to make of the license requirements for Gerry's stuff right now. GPL isn't compatible with MPL and has some ramifications I've been avoiding. We may have to take it back out.

Not to be a big hurking beureaucrat, but can you run third-party stuff by me before checking it in? I'm sorry that I haven't been spending the time to keep up with Gerry's string stuff. Probably not a big deal.

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
Decent Apps - open source tools for writing and deploying privacy-focused LLM-based web apps.
07-22-2003 at 09:31 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2810
Registered: 02-04-2003
IP: Logged
icon Re: Linux DROD (0)  
trick wrote:
Also, i got the official char traits header from the libstdc++ cvs (with permission :))
I'm curious--what did you need permission for?
and put it in BackEndLib (pod_char_traits.h, in the zip), removed most things from CharTraits.h, and made it include that file. That way we can easily change it to include <ext/pod_char_traits.h> in stead when it is in a stable libstdc++ release. I also ripped out the license part from CharTraits.h, since i'm a bit unsure what to put it under - the libstdc++ version of the GPL, since it adds some things to the pod_char_traits definitions, or the MPL, like the rest ?
Okay, I read the license and I get the runtime exception thing. I thought we had plain old GPL code on our hands and that would have screwed it.

Can we leave pod_char_traits.h and basically anything from libstd out of the Caravel repository? I would like to use unmodified file(s) from libstdc++ and just change the include path. This way I don't have to rewrite text in several places to say "All source code in the distribution EXCEPT this one file is licensed under MPL.".

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
Decent Apps - open source tools for writing and deploying privacy-focused LLM-based web apps.
07-22-2003 at 10:01 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged
icon Re: Re: Linux DROD (0)  
ErikH2000 wrote:
I'm curious--what did you need permission for?
Oh, i didn't really need permission once it was under its current license, but when i first found this and contacted the libstdc++ guys about it, the solution only existed in a mailinglist archive, with no license in sight. It wasn't included in libstdc++ at all. So, i explained the situation to the author of the fix and asked if it could be used in a commercial app (keeping in mind the agreement i signed some time ago - did you get it yet ?). If he said no i was prepared to try to figure out another way, but luckily he said yes, put the thing under the libstdc++ version of the GPL like the rest of libstdc++, and included it as an extension to the lib.

Can we leave pod_char_traits.h and basically anything from libstd out of the Caravel repository? I would like to use unmodified file(s) from libstdc++ and just change the include path. This way I don't have to rewrite text in several places to say "All source code in the distribution EXCEPT this one file is licensed under MPL.".
Sure, no problem. The reason i thought we could have it there for now is that it's not actually part of any libstdc++ release yet, so anyone compiling the thing will have to go get a copy from the libstdc++ CVS (or get the file from me). Anyway, sorry for adding it in the patch without asking first. Won't happen again.

- Gerry

07-22-2003 at 11:10 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged
icon Re: Re: Linux DROD (0)  
mrimer wrote:
I just changed all the reinterpret_casts to either static_casts, for primitive data types, or dynamic_casts (DYN_CAST) for class casts. I'm wondering whether this might cause anything to run more smoothly on Linux.
I'll let you know when it's done compiling. In the mean time, i actually had to change two static_cast's in FrontEndLib/FontManager.cpp::RenderWord to reinterpret_cast's again, where it casts WCHAR* to Uint16*, because the WCHAR is an "incompatible" type. The casting shouldn't introduce any problems (and doesn't, the text renders fine) since the WCHAR struct contains just one variable and no methods.

Edit: Had to change one in DROD/DrodFontManager.cpp::Init too.

- Gerry


[Edited by trick on 07-22-2003 at 11:23 PM]
07-22-2003 at 11:17 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
12
Page 3 of 4
4
New Topic New Poll Post Reply
Caravel Forum : Caravel Boards : Development : Linux DROD
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.9
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.