View previous topic :: View next topic |
Author |
Message |
clayasaurus
Joined: 21 May 2004 Posts: 857
|
Posted: Tue Mar 01, 2005 4:22 pm Post subject: |
|
|
argh, i can save the data perfectly fine but when i try to load i get this error...
unknown class requested from the factory: @
I put the factory declarations in the static this() module.
I can save the data perfectly fine.
here are my factory declarations
Code: |
new factory.type!(ID);
new factory.type!(List!(Tile));
new factory.type!(List!(ID));
new factory.type!(Map);
new factory.type!(Tile);
|
and here is how i describe the map
Code: |
debug writefln("map: attempting to describe");
s.prim!(int)(mapWidth);
s.prim!(int)(mapHeight);
s.prim!(int)(mapNum);
s.prim!(int)(tileSize);
s.prim!(int)(halfTileSize);
s.prim!(int)(quarterTileSize);
s.prim!(float)(transVertical);
s.prim!(float)(transHorizontal);
debug writefln("map: described primatives");
s.obj!(Tile)(mouseTile);
s.obj!(ID)(currID);
debug writefln("map: described mouseTile and currID");
s.obj!(List!(Tile))(tiles);
s.obj!(List!(ID))(ids);
debug writefln("map: describe success!");
|
when i try and load it, it doesn't even print the first debug message. putting
new factory!(Map), before I load doesn't make a difference
I was wondering if you know a good way to debug such an error?
edit: here is how i describe a map from a high level view
Code: |
bool load(char[] argFileName)
{
try
{
// open file + serializer and write em'
File file = new File(argFileName, FileMode.In);
debug writefln("engine: opened ", argFileName, " for writing");
Serializer s = new Serializer(file, Serializer.SMode.R);
debug writefln("engine: opened serializer for writing");
if (!(map is null))
{
delete map;
debug writefln("engine: map destroyed");
}
s.obj!(Map)(map);
//map.describe(s);
debug writefln("engine: described map");
file.close();
debug writefln("close file");
delete s;
debug writefln("engine: save successfull");
return true;
}
catch (Exception e)
{
debug writef("engine: load failed... ");
e.print();
return false;
}
}
|
|
|
Back to top |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Tue Mar 01, 2005 4:33 pm Post subject: |
|
|
The problem probably comes out of D's lack of advanced RTTI. Both List!(ID) and List!(Tile) have the same classinfo.name: "List" and this doesn't do any good...
Solution:
new factory.type!(List!(Tile))("List!(Tile)");
new factory.type!(List!(ID))("List!(ID)");
Lemme know if it works... |
|
Back to top |
|
|
clayasaurus
Joined: 21 May 2004 Posts: 857
|
Posted: Tue Mar 01, 2005 6:57 pm Post subject: |
|
|
thanks for the tip : ) I can happily serialize/unserialize my game world now. |
|
Back to top |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Fri Mar 04, 2005 12:47 pm Post subject: |
|
|
Dunno if here's the right place to post it, but I've succeeded integrating ODE into the 'engine' :) Also check the tank's tracks. They are now dynamically generated using Catmull-Rom splines
http://codeinsane.info/code/heresy/test3.rar (approx 1MB)
How's your project, Clay ? :] |
|
Back to top |
|
|
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Fri Mar 04, 2005 9:13 pm Post subject: |
|
|
Looking good! I noticed you didn't include the dumbestBot.exe with the archive this time so I used the one from test2.rar. The tank crashed into the other, bumping and nudging it realistically until it was out the way. Quite incredible, really! Great job!
I'd like to download the source and have a look at it, but your site only displays the source. Is there any archive of the source that I could quickly download?
Not sure if this topic should stick around in here... probably best to move it into general forum where more people might see it. I think you've got a promising project going there. Good luck.
- JJR. |
|
Back to top |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Sat Mar 05, 2005 2:43 am Post subject: |
|
|
http://codeinsane.info/code/heresy/src.zip
Quote: |
I noticed you didn't include the dumbestBot.exe |
But... you've tried using the keyboard, rite ?
Keys: qweasd ; uiojkl
Quote: |
Not sure if this topic should stick around in here... probably best to move it into general forum where more people might see it. I think you've got a promising project going there. Good luck. |
Thanks for the feedback I'll probably post to the general forum when I make some other cool addition.
BTW, What sort of FPS are you getting and on what config ? |
|
Back to top |
|
|
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Sat Mar 05, 2005 4:47 am Post subject: |
|
|
Thanks for the source!
And no, I had no idea I could control the tanks with those keys. That just made it feel so much more realistic. The physics are incredible!
My machine is a 1.4 GHz Pentimum M laptop. 1 GB of 266 DDR RAM. ATI 9200 with 32 MB dedicated DDR VRAM. OS is WinXP HE SP2. Does that library compile on Linux yet?
FPS averaged between 230 and 240. Maybe you could start a project on dsource? If so, these last few posts can be moved to a new forum.
- JJR |
|
Back to top |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Sat Mar 05, 2005 9:35 am Post subject: |
|
|
Quote: | That just made it feel so much more realistic. The physics are incredible! |
I was shocked as well
Quote: | Maybe you could start a project on dsource? If so, these last few posts can be moved to a new forum. |
Maybe... But I'd have to learn how to use SVN. However I'm gonna keep the source code open so it may be the best idea actually
Quote: | Does that library compile on Linux yet? |
Dunno exactly what you mean, but as far as ODE is concerned, it compiles on Linux. At the moment my 'demo' doesn't work on Linux, as I'm loading ODE functions from a .dll (got pissed @ static linking problems). If I find some time, I'm gonna make it work on Linux. I'll need to install it first, though. My last distro made me mad and died tragically, killed by Partition Magic |
|
Back to top |
|
|
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Sat Mar 05, 2005 12:45 pm Post subject: |
|
|
h3r3tic wrote: | Quote: | Maybe you could start a project on dsource? If so, these last few posts can be moved to a new forum. |
Maybe... But I'd have to learn how to use SVN. However I'm gonna keep the source code open so it may be the best idea actually |
SVN is not too difficult to figure out on Windows. If you've ever used CVS, I would say the SVN tool is much simpler to understand/learn. Post a request to Brad in the "Potential Projects" forum if you decide you would like to put this on svn. I hope you do!
h3r3tic wrote: | Quote: | Does that library compile on Linux yet? |
Dunno exactly what you mean, but as far as ODE is concerned, it compiles on Linux. At the moment my 'demo' doesn't work on Linux, as I'm loading ODE functions from a .dll (got pissed @ static linking problems). |
Sorry. What I meant was: does your project compile on Linux yet? But you've answered my question. It looks like you're using Derelict for the GL portion of the project, so it should be straightforward to port it to Linux. First, though, you would need a D ODE interface set up for Linux or the ODE library would need to be added to Derelict. I've posted a request to Aldacron concerning ODE already. We'll see what he says. If it's in Derelict, it will be nicely cross-platfrom.
h3r3tic wrote: | If I find some time, I'm gonna make it work on Linux. I'll need to install it first, though. My last distro made me mad and died tragically, killed by Partition Magic |
Linux isn't always that easy to get started with. It gets trickier if you want it to share a hard drive with a MS OS. As for linux itself, as much as I enjoy working with the system, I still often get frustrated with the rediculous complexity of the system (scripts, system administration, etc). Troubleshooting simple problems can be a nightmare. How does that make Linux an improvement over other OS's, I sometimes wonder. I am most content just staying away from some of the system oriented stuff and sticking to app programming. In that regard, I consider it much simpler to work with than windows (linking with shared libraries, for one, is so much easier).
- JJR |
|
Back to top |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Sat Mar 05, 2005 2:28 pm Post subject: |
|
|
JJR wrote: | SVN is not too difficult to figure out on Windows. If you've ever used CVS, I would say the SVN tool is much simpler to understand/learn. Post a request to Brad in the "Potential Projects" forum if you decide you would like to put this on svn. I hope you do! |
Well, I haven't ever used a version control system, but I'm sure I can handle it
Quote: | It looks like you're using Derelict for the GL portion of the project, so it should be straightforward to port it to Linux. First, though, you would need a D ODE interface set up for Linux or the ODE library would need to be added to Derelict. I've posted a request to Aldacron concerning ODE already. We'll see what he says. If it's in Derelict, it will be nicely cross-platfrom. |
Thanks for asking Aldacron sure it'd be nice if ODE was part of Derelict, so more people could use it without the pain of converting C headers. I had to record a macro in jEdit to convert function declarations to type aliases and function pointer declarations, make a Python script to generate dynamic binding code and do some other tweaking... Not exactly very hard but not everyone would be willing to do it. Surely `Derelict ~= ODE` would be cool.
Quote: | Linux isn't always that easy to get started with. It gets trickier if you want it to share a hard drive with a MS OS. As for linux itself, as much as I enjoy working with the system, I still often get frustrated with the rediculous complexity of the system (scripts, system administration, etc). Troubleshooting simple problems can be a nightmare. How does that make Linux an improvement over other OS's, I sometimes wonder. I am most content just staying away from some of the system oriented stuff and sticking to app programming. In that regard, I consider it much simpler to work with than windows (linking with shared libraries, for one, is so much easier). |
Sure Linux isn't perfect. It's not bad but it's not also what it's heralded as... I just like having all these easy installs and wizards on Windows + few clicks to do everything instead of writing shellscripts. Sure I could, but I'm too lazy for it. And the worst of all is that I don't have DIDE on Linux I'd have to use KDevelop...
Well, screw Linux and Windows, we need an OS written in D |
|
Back to top |
|
|
clayasaurus
Joined: 21 May 2004 Posts: 857
|
Posted: Thu Mar 10, 2005 4:27 pm Post subject: |
|
|
h3r3tic wrote: | Dunno if here's the right place to post it, but I've succeeded integrating ODE into the 'engine' Also check the tank's tracks. They are now dynamically generated using Catmull-Rom splines
http://codeinsane.info/code/heresy/test3.rar (approx 1MB)
How's your project, Clay ? :] |
That almost runs on linux under cedega, except for some reason my GLU doesn't have the tess stuff in it! argh. "Failed to load glu proc address gluGetTessProperty"
Oh well, with the new derelict coming out you should be able to handle that properly, unless you make use of gluGetTessProperty() in your program. or i just need to figure out why my version of GLU doesn't have it.
My project is fine so far, got basic map tiles/editor working, working on user interface stuff using opengl, salvaged my old code, and i just need some type of in game menu, then I can start working on robots that attack each other, buildings, resources, and other fun stuff. |
|
Back to top |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Thu Mar 10, 2005 4:35 pm Post subject: |
|
|
clayasaurus wrote: | That almost runs on linux under cedega, except for some reason my GLU doesn't have the tess stuff in it! argh. "Failed to load glu proc address gluGetTessProperty" |
But wait.. I'm not using GLU tess stuff... I'm doing spline interpolation by hand.
Quote: | My project is fine so far, got basic map tiles/editor working, working on user interface stuff using opengl, salvaged my old code, and i just need some type of in game menu, then I can start working on robots that attack each other, buildings, resources, and other fun stuff. |
Cool ! Can't wait to see it ! Good luck
~Tom |
|
Back to top |
|
|
clayasaurus
Joined: 21 May 2004 Posts: 857
|
Posted: Thu Mar 10, 2005 4:44 pm Post subject: |
|
|
Quote: |
Linux isn't always that easy to get started with. It gets trickier if you want it to share a hard drive with a MS OS. As for linux itself, as much as I enjoy working with the system, I still often get frustrated with the rediculous complexity of the system (scripts, system administration, etc). Troubleshooting simple problems can be a nightmare. How does that make Linux an improvement over other OS's, I sometimes wonder. I am most content just staying away from some of the system oriented stuff and sticking to app programming. In that regard, I consider it much simpler to work with than windows (linking with shared libraries, for one, is so much easier).
- JJR |
Hum.. some linux distros are easier to use than others. For instance, if i'm not mistaken, JJR uses gentoo, which is powerfull but needs a lot of learning to use.
I'm a bum, so i use mepis (www.mepis.org), which is easier to install than windows, and easier to update than windows, and easier to use, unless you bork up your system badly, but even then there is a 'repair' function on the live CD, and you can always reinstall the root data while keeping all your user data. (yes, i have installed windows, it takes hours, while this only takes less than 25 min, i have also updated windows many times, part of that includes removing viruses before update).
If i were you i would only use linux if you had an extra box to spare so you don't have to go through the horrors of dual booting, been there, done that. Or if you don't mind using linux exclusively, which, being on windows, you prob will.
Orr.. if you have a 2 CD roms drives and one of them can write to CD's, the latest live CD of puppy linux allows one CD to run the OS off of and another CD to write all new data to, you you never have to install linux in the first place. But it is annoying waiting for the CD.
or you can goto distrowatch.org and choose a diff one.
but if you dont' do linux it doesn't matter. there are enough around who do, and those that do, will tell you all you need to know for it to work on linux |
|
Back to top |
|
|
clayasaurus
Joined: 21 May 2004 Posts: 857
|
Posted: Thu Mar 10, 2005 4:46 pm Post subject: |
|
|
h3r3tic wrote: | clayasaurus wrote: | That almost runs on linux under cedega, except for some reason my GLU doesn't have the tess stuff in it! argh. "Failed to load glu proc address gluGetTessProperty" |
But wait.. I'm not using GLU tess stuff... I'm doing spline interpolation by hand.
~Tom |
but derelict still tries to load it anyway, and throws a exception if it can't
h3r3tic wrote: | can't wait to see it! |
here http://svn.dsource.org/svn/projects/warbots/web/index.html
prob not what you meant, but ... |
|
Back to top |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Thu Mar 10, 2005 4:52 pm Post subject: |
|
|
As for the linux porting, I've already ported a simple OpenGL based game to Linux, so it won't be that scary. Dual booting ? Also done that. At home and at my university, it wasn't that scary at all. But I'm gonna use Windows anyway and just periodically check if the thing compiles on Linux (like I used to code in C++ - develop in Visual Studio, check with MinGW). I just like the general feel of Windows and some programs on Linux just killed my sympathy for the penguin (mainly KDevelop, KDE and sound systems in general). |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|