FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

some suggestions
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic     Forum Index -> Claytek 3D
View previous topic :: View next topic  
Author Message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Wed Sep 15, 2004 8:30 am    Post subject: Reply with quote

the sample you gave me works on linux.. it's just i can't get it to work with my project Embarassed
Back to top
View user's profile Send private message AIM Address
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Wed Sep 15, 2004 8:31 am    Post subject: Reply with quote

maybe if you posted/sent me some of your src code I could help :)
Back to top
View user's profile Send private message MSN Messenger
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Sat Dec 25, 2004 6:43 pm    Post subject: Reply with quote

The serialization code is confusing to me and seems to only work with classes. Thanks for all the help and support but I think my next goals are some sort of decent x-platform GUI.
- clayasaurus
Back to top
View user's profile Send private message AIM Address
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Sat Dec 25, 2004 6:46 pm    Post subject: Reply with quote

sorry if it doesn't work for you :/ i'm playing at the moment with some opengl stuff in D. just wrote an .ASE loader, i'll be doing serialization soon. maybe then i'll have more useful suggestions :)
Back to top
View user's profile Send private message MSN Messenger
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Mon Dec 27, 2004 10:58 pm    Post subject: Reply with quote

Yipee! I've got a new spiffy serializer. It's faster, cleaner and more flexible. You can take a look at it (and some other toys of mine) here: http://codeinsane.info/listDir.spy?viewType=detailed&path=code?2Fheresy

Serialization is really a GoodThing(tm). I just load my data, preprocess it, serialize and can unserialize it without any hassle by just calling one function on the Serializer class.
As a bonus, a deepCopy function comes for free for objects that can be serialized and unserialized.

Any (questions || comments || flames) : lemme know.
Back to top
View user's profile Send private message MSN Messenger
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Wed Jan 12, 2005 4:03 pm    Post subject: Reply with quote

Hey thx for the post.

When i go to view your code i get Message: IOError: [Errno 28] No space left on device
I guess the webpage is down.

I'll take a look at it again once i get my new computer : ) The old ones exploded

One question again, can you serialize structures? or are they only for classes?
Thank, ttyl
- clayasaurus
Back to top
View user's profile Send private message AIM Address
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Thu Jan 13, 2005 9:00 am    Post subject: Reply with quote

oh damn... sorry for that. it's back alive :] thanks for letting me know. and yeah, the new serializer supports structs and pretty much anything you'd like to serialize... these files aren't in their up to date versions cuz temporairly i don't have a net connection @ home :/ yet the serializer hasn't been changed afaics.
Back to top
View user's profile Send private message MSN Messenger
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Sat Jan 22, 2005 9:12 pm    Post subject: Reply with quote

when compiling serializer with dmd .111 i get the following errors

Code:

engine/serializer.d(17): no property 'W' for type 'int'
engine/serializer.d(17): constructor engine.serializer.Serializer.this (Stream buf,Mode mode) does not match argument types(MemoryStream ,int)
engine/serializer.d(17): Error: expected 1 arguments, not 2

engine/serializer.d(20): no property 'R' for type 'int'
engine/serializer.d(20): constructor engine.serializer.Serializer.this (Stream buf,Mode mode) does not match argument types(MemoryStream ,int)
engine/serializer.d(20): Error: expected 1 arguments, not 2
Back to top
View user's profile Send private message AIM Address
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Sat Feb 19, 2005 5:20 pm    Post subject: Reply with quote

... and that's a bug introduced in dmd.111 :( it works just fine in dmd.110. There's something weird about the identifier 'Mode' and std.stream. Either compile in dmd.110 or change the 'Mode' to something else, like 'SMode' and it will work...
Sorry for the delay, I havent had very much free time recently... Had to pass my exams at the uni.
Back to top
View user's profile Send private message MSN Messenger
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Mon Feb 28, 2005 4:53 pm    Post subject: Reply with quote

nice job with the serializer! i just had to change Mode to SMode.

I think you should lobby to get a form of the serializer included into phobos, maybe you can get it to all fit in one file?

I will be using it in my project warbots and then rehash claytek to use it in the future, when i feel like working on it again.
Back to top
View user's profile Send private message AIM Address
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Mon Feb 28, 2005 5:23 pm    Post subject: Reply with quote

I'm glad I could help, yeah I will put it into one file, I originally planned for longer code... but D makes it damn simple to implement advanced concepts. Dunno if it should be in Phobos though ;] it'd need some revisions of coders with more experience than me.

As for the WarBots project, I've also decided that making an FPS is a longterm project and I need something that's fun... so I'm making something pretty similar, something like Robocode but in 3D. You can take a look at a few days old release (Win32) here:
http://codeinsane.info/code/heresy/test2.rar
Currently I'm integrating ODE - Open Dynamics Engine into the system, when I'm done, I'm gonna release another techdemo.
One interesting decision I've done about it, is that the 'Bots' will communicate with the host program not thru DLL callbacks or anything like this... but through network... either loopback or from a remote machine. If I write specific libs, I will be able to make Bots in D or Python, or any other nice language. Right now there isn't too much for the host-bot communication, but definitely it works ok and the networking code is extremely simple... I'm just passing a SocketStream to the Serializer and literally sending my data structures :D
I've uploaded the most recent sources to my site, it compiles fine on WinXP, yet I haven't had time to play around with dynamic ODE loading on Linux and other platforms.
Again, feel free to use any of the code I'm providing there, it may not be of the highest quality, as it's a work-in-progress. Yet I'm desperate to finish this project and whenever I have some free time off my uni, I'm gonna put it into this lil project :>

EDIT: I've renamed Mode to SMode and moved the factory from objFactory.d to serializer.d, the sources on my webpage are up-to-date
Back to top
View user's profile Send private message MSN Messenger
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Mon Feb 28, 2005 7:18 pm    Post subject: Reply with quote

Inside the describe function, is there anyway to discriminate between reading and writing?

I think I may have run myself into a rut with the serializer. I made myself a List template, which is an easy way to make a linked list class with any data type.

here is the different code for reading/writing linked list

Code:

   void describe(Serializer s)
   {
      Node curr = head;
      s.prim!(size);
     
      // writeing a linked list
      if (write)
      {
         while (!(curr is null))
         {
            s.obj!(curr);
            curr = curr.next;
         }
      }
      else // reading a linked list
      {
         for (int i = 0; i < size; i++)
         {
            Node NNP; // do i have to use = new here?
            s.obj!(NNP);
            add(NNP);
         }
      }
   }


also, do i have to register classes with the object factory? how would i go about doing so?

When I load the objects with describe, do i have to allocate the memory for them, or does the serializer do that?
Back to top
View user's profile Send private message AIM Address
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Mon Feb 28, 2005 7:58 pm    Post subject: Reply with quote

Duh, I think I can answer my own questions now. #1, they don't have to be in the object factory and #2,

Code:

   void describe(Serializer s)
   {
      Node curr = head;
      s.prim!(size);
     
      // writeing a linked list
      if (Serializer.SMode.W == s.mode)
      {
         while (!(curr is null))
         {
            s.obj!(curr);
            curr = curr.next;
         }
      }
      else // reading a linked list
      {
         for (int i = 0; i < size; i++)
         {
            Node NNP;
            s.obj!(NNP);
            add(NNP);
         }
      }
   }

Back to top
View user's profile Send private message AIM Address
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Tue Mar 01, 2005 1:32 am    Post subject: Reply with quote

h3r3tic wrote:
As for the WarBots project, I've also decided that making an FPS is a longterm project and I need something that's fun... so I'm making something pretty similar, something like Robocode but in 3D. You can take a look at a few days old release (Win32) here:
http://codeinsane.info/code/heresy/test2.rar


I was shocked to see how impressive this sample was, h3r3tic. Very nice work! It runs beautifully. How did you create the 3D models? They're incredible. The animation is smooth and detailed. I'd like to see this one developed more!

- JJR
Back to top
View user's profile Send private message
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Tue Mar 01, 2005 5:11 am    Post subject: Reply with quote

Clay:
Quote:
also, do i have to register classes with the object factory? how would i go about doing so?


Yeah, classes need to be registered with the factory, so that they can be properly unserialized. Sample from my code:
Code:

static this()
{
   new factory.type!(BasicNode);
   new factory.type!(TransformNode);
   new factory.type!(Geode);
   new factory.type!(Camera);
}



Quote:
When I load the objects with describe, do i have to allocate the memory for them, or does the serializer do that?


The serializer does it with the factory.make method. Right now for this to be possible, the class has to have a default constructor, as it's new'ed in a template that doesn't know what params should be passed... Currently I can't think of a better solution...


JJR:
Quote:

I was shocked to see how impressive this sample was, h3r3tic. Very nice work! It runs beautifully. How did you create the 3D models? They're incredible. The animation is smooth and detailed. I'd like to see this one developed more!


Thanks ! The models were created by my brother in 3dsmax, then exported info .ASE (Ascii Scene Export), loaded into the engine, converted into a scenegraph, finally serialized into the 'tank.txt' and 'artilery.txt' files. As for the animation - I'm doing 60 updates of the game logic per second, at most 10 updates per frame, so that as long as the machine can keep up at least 6fps, there will be 60 updates per second.
I'll let ya know when I make some progress :]


By the way, I find the GC in D extremely convenient - I can invoke all initialization code without ever caring to do a 'delete', then just before entering the 'realtime part', call std.gc.fullCollect(); and never allocate memory again... or free it right after, use mem pools / etc
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Claytek 3D All times are GMT - 6 Hours
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
Jump to:  
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