Project 137

A forum to show of the stuff you did for your server.

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

Re: Project 137

Postby PurpleYouko on Thu Mar 24, 2016 2:19 pm

It's not crashing while loading the skills.
Everything loads (or appears to load) just fine.
It crashes on entry into the world when it starts populating the visibility lists. The NPClist is corrupted and cannot be addressed. Funny thing is that it doesn't actually crash. If i click debug and open the visual studio debugger and then close it again the server continues to run and is accessing the visibility lists just fine.... but it's greyed out and cannot be selected or closed any more.

That's where I'm different to most of you. I'm using VS2010 to compile. NOT codeblocks. Maybe I forgot to mention that earlier.
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: Project 137

Postby L3nn0x on Thu Mar 24, 2016 6:16 pm

Yeah it looks like you're really messing with the memory, I don't know when but the loading looks like a potential culprit for me.

And don't worry, I don't use code::blocks either. It has nothing to do with the IDE.
L3nn0x
osiRose dev
osiRose dev
 
Posts: 111
Joined: Wed Oct 21, 2015 8:22 pm

Re: Project 137

Postby PurpleYouko on Tue Mar 29, 2016 5:29 pm

Think I've cracked it.
Seems like I had miscalculated loading quest flags.
I'm not using a memory dump like the normal version. I pulled all the quest data into discrete structures for saving and loading since it's easier to debug that way.
Had it all set up nicely to mirror the structures in the client with a nice union to make it easier to delete groups of quest flags as done in QUESTREWD(016)
in case you don't have that coded (most people probably don't) here is the code that I use now since figuring it out from the client code.

  1. //Group Flag Clear
  2. QUESTREWD(016)
  3. {
  4.     //word nGroupSN
  5.     GETREWDDATA(016);
  6.     //there are 16 groups of 32 flag bits
  7.     UINT Startpos = data->nGroupSN * 32;
  8.     UINT EndPos = Startpos + 32;
  9.     for(UINT i = Startpos; i < EndPos; i++)
  10.     {
  11.         client->quest.Qflags[i] = 0;
  12.     }
  13.     return QUEST_SUCCESS;
  14. }


It was previously set up to delete a group in one go due to this code in datatypes.h where the flag structures is set up
  1. union
  2.     {
  3.         byte  Qflags    [QUEST_SWITCH_CNT / 8 ];    //64
  4.         DWORD dwFlags   [QUEST_SWITCH_CNT / 32];    //16
  5.     };

QUEST_SWITCH_CNT is defined as 512 which is the maximum number of switch-bits used for the flags.
And that was my problems. BITS not bytes
The above code gives me an array of 64 Qflag bytes each of which would have to contain 8 bits.
The actual values coming in from the QSD are in BITs so it might tell me to set FLAG BIT number 498..... but I only have 64 bytes in my array so...... MASSIVE memory overwrites going on
I have now changed the entire structure to remove dwFlags completely and set byte Qflags [QUEST_SWITCH_CNT] so it's now a 512 array, hence the loop in the quest reward instead of simply setting the dwFlags entry to 0.
The character that was causing all my troubles now logs in fine.
This also explains why I've been getting logging issues seemingly randomly for some while now. Hopefully this will be the end of it so that I can actually move on with fixing up the stuff that will make the game more fun to play :D

ABE
Actually i suppose this would have worked just as well. Meh.. Whatever
  1. union
  2.     {
  3.         byte  Qflags    [QUEST_SWITCH_CNT];             //512
  4.         DWORD dwFlags   [QUEST_SWITCH_CNT / 32];    //16
  5.     };
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: Project 137

Postby L3nn0x on Tue Mar 29, 2016 6:50 pm

Ahah good job figuring that error, it was really nasty and basically hidden in plain sight :mrgreen:

Well I can't wait to see what'll be next now.
L3nn0x
osiRose dev
osiRose dev
 
Posts: 111
Joined: Wed Oct 21, 2015 8:22 pm

Re: Project 137

Postby Totat on Thu Mar 31, 2016 3:01 am

Wait what language is this on again?
it looks a lot like java for some reason
I make animations and 2d effects
Totat
Pomic
Pomic
 
Posts: 75
Joined: Mon Jun 01, 2015 9:15 pm
Location: Discord: Add me! What#7452

Re: Project 137

Postby Raven0123 on Thu Mar 31, 2016 3:20 am

Totat wrote:Wait what language is this on again?
it looks a lot like java for some reason


It's C++. The reason why it looks like java is because java is really close to c.
User avatar
Raven0123
osiRose dev
osiRose dev
 
Posts: 379
Joined: Tue Sep 11, 2007 11:06 pm
Location: USA, NJ

Re: Project 137

Postby Totat on Thu Mar 31, 2016 8:20 am

ohh okay thanks.
I make animations and 2d effects
Totat
Pomic
Pomic
 
Posts: 75
Joined: Mon Jun 01, 2015 9:15 pm
Location: Discord: Add me! What#7452

Re: Project 137

Postby PurpleYouko on Mon Apr 04, 2016 7:08 pm

Finally got past all the crap with quest saving, flags, world variables and such.
Had to redesign the database tables a little and then recode all the quest loading and saving from the ground up so that everything goes into precisely the right memory location and so that it all matches up with the client memory in the packet structure.

Wheeew *wipes sweat from forehead*
That took a lot of work.

Crafting now works too. Had to recode the function for that too. It wasn't matching the incoming 0x07af packet from the client so I was getting bizarre item numbers and inventory locations coming through.

I think that might just be ALL the basic functions working now. I can't actually think of another known bug that would prevent actual game play.
There are plenty of minor ones left in the client and server but nothing critical as far as I'm aware.
Stupid little things like hotbar buttons not working with the mouse. You can use hotbar stuff from hot keys and you can cast skills from the skills window with the mouse. just that the mouse doesn't work to activate hotbar keys.
I'm not too worried about that right now. I can figure it out by seeing how it's coded for the skills window and copy it over (with mods obviously)

I think i will move on to some completely new stuff next.
Monster colliding with scenery (server side) is something that I need to get done so I might start looking into that. :D
probably start with loading heightmaps into the map structures so i can use maximum slope from point to point in order to prevent monsters from climbing cliffs and even leaving the maps after I implement dynamic spawning.
This is going to be interesting. lol
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: Project 137

Postby Raven0123 on Mon Apr 04, 2016 8:11 pm

PurpleYouko wrote:Finally got past all the crap with quest saving, flags, world variables and such.
Had to redesign the database tables a little and then recode all the quest loading and saving from the ground up so that everything goes into precisely the right memory location and so that it all matches up with the client memory in the packet structure.

Wheeew *wipes sweat from forehead*
That took a lot of work.

Crafting now works too. Had to recode the function for that too. It wasn't matching the incoming 0x07af packet from the client so I was getting bizarre item numbers and inventory locations coming through.

I think that might just be ALL the basic functions working now. I can't actually think of another known bug that would prevent actual game play.
There are plenty of minor ones left in the client and server but nothing critical as far as I'm aware.
Stupid little things like hotbar buttons not working with the mouse. You can use hotbar stuff from hot keys and you can cast skills from the skills window with the mouse. just that the mouse doesn't work to activate hotbar keys.
I'm not too worried about that right now. I can figure it out by seeing how it's coded for the skills window and copy it over (with mods obviously)

I think i will move on to some completely new stuff next.
Monster colliding with scenery (server side) is something that I need to get done so I might start looking into that. :D
probably start with loading heightmaps into the map structures so i can use maximum slope from point to point in order to prevent monsters from climbing cliffs and even leaving the maps after I implement dynamic spawning.
This is going to be interesting. lol


Haha, I'm really jelly right now. Your moving so fast atm where osirose is moving slower. :P But then again we aren't using the old source.

Anyway good work.
User avatar
Raven0123
osiRose dev
osiRose dev
 
Posts: 379
Joined: Tue Sep 11, 2007 11:06 pm
Location: USA, NJ

Re: Project 137

Postby L3nn0x on Tue Apr 05, 2016 9:27 am

Good work!

And we'll definitely catch up to you with our own server, don't worry :twisted:
L3nn0x
osiRose dev
osiRose dev
 
Posts: 111
Joined: Wed Oct 21, 2015 8:22 pm

PreviousNext

Return to Pimp My Rose

Who is online

Users browsing this forum: No registered users and 4 guests

cron