Mirage Source

Free ORPG making software.
It is currently Sat Apr 27, 2024 8:07 pm

All times are UTC




Post new topic Reply to topic  [ 44 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: MS4
PostPosted: Tue Aug 18, 2009 1:48 pm 
Offline
Persistant Poster

Joined: Fri Jun 26, 2009 10:15 pm
Posts: 701
Google Talk: FAProductions
This is my version of MS4, with a lot of help from Jacob.

What makes this one different from the current release? Dynamic maps.

You can set the maps from the default max_mapx and max_mapy to 255. 255x255 is the biggest you can go and trust me, there's no need to go higher than that.

With the byte array packets sending maps that large won't be a problem. Even that huge, they will send just as fast as a normal size map.

Anyways, I've bored you enough. Here's the download: MS4 Dynamic Maps, Byte Arrays


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Tue Aug 18, 2009 2:37 pm 
Offline
Knowledgeable
User avatar

Joined: Wed Jul 26, 2006 11:22 pm
Posts: 143
Location: Virginia, USA
I've got a pretty good feeling there's another step other than setting MAX_MAPX and MAX_MAPY...

Image


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Tue Aug 18, 2009 2:39 pm 
Offline
Persistant Poster

Joined: Fri Jun 26, 2009 10:15 pm
Posts: 701
Google Talk: FAProductions
Haha. I didn't fully test it all. I just did the byte array packets over the pass 2 days or so. I'll get it fixed. Thanks.


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Tue Aug 18, 2009 2:42 pm 
Offline
Persistant Poster

Joined: Fri Jun 26, 2009 10:15 pm
Posts: 701
Google Talk: FAProductions
Actually, after showing Jacob this, he told me what you did wrong. You don't change the map size in the code. When you edit a map, you change it in the properties for that map. ;)


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Tue Aug 18, 2009 2:43 pm 
Offline
Knowledgeable
User avatar

Joined: Wed Jul 26, 2006 11:22 pm
Posts: 143
Location: Virginia, USA
:o Oh-hoh. So that's how to make it work.

Thanks guys. :)


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Tue Aug 18, 2009 2:44 pm 
Offline
Persistant Poster

Joined: Fri Jun 26, 2009 10:15 pm
Posts: 701
Google Talk: FAProductions
Kousaten wrote:
:o Oh-hoh. So that's how to make it work.

Thanks guys. :)


Lol. After all the debugging we did with the byte arrays, I was going to kill you if you had found another bug. >.>


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Tue Aug 18, 2009 2:47 pm 
Offline
Knowledgeable
User avatar

Joined: Wed Jul 26, 2006 11:22 pm
Posts: 143
Location: Virginia, USA
Nah. :P It works beautifully.

I was going to write in seamless for MS4, but this works a ton better since you don't have to make excess maps for filling in the black spots.


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Tue Aug 18, 2009 2:48 pm 
Offline
Persistant Poster

Joined: Fri Jun 26, 2009 10:15 pm
Posts: 701
Google Talk: FAProductions
Kousaten wrote:
Nah. :P It works beautifully.

I was going to write in seamless for MS4, but this works a ton better since you don't have to make excess maps for filling in the black spots.


Yupp.


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Tue Aug 18, 2009 2:51 pm 
Offline
Pro
User avatar

Joined: Tue Nov 13, 2007 2:42 pm
Posts: 509
You will need to think about dynamically changing NPC and Item limits for larger maps.


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Tue Aug 18, 2009 2:53 pm 
Offline
Knowledgeable
User avatar

Joined: Wed Jul 26, 2006 11:22 pm
Posts: 143
Location: Virginia, USA
Otherwise you're going to end up with a few very sparse maps. :3 I hear ya~


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Tue Aug 18, 2009 2:56 pm 
Offline
Persistant Poster

Joined: Fri Jun 26, 2009 10:15 pm
Posts: 701
Google Talk: FAProductions
In my game source, I have it to where you can set 1 to 50 npcs per map and you choose how many go on each map.


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Tue Aug 18, 2009 3:00 pm 
Offline
Pro
User avatar

Joined: Tue Nov 13, 2007 2:42 pm
Posts: 509
I got all crazy with my setup:
viewtopic.php?f=8&t=5147&start=0&hilit=npc+spawn


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Tue Aug 18, 2009 6:01 pm 
Offline
Knowledgeable
User avatar

Joined: Wed Jul 26, 2006 11:22 pm
Posts: 143
Location: Virginia, USA
One problem I did notice was that the map name doesn't draw properly--this causes it to just stay where it was on the original sized map.

I fixed it by changing:

Code:
' Draw map name
        Call DrawText(TexthDC, DrawMapNameX, DrawMapNameY, Map.Name, DrawMapNameColor)


To:

Code:
' Draw map name
        Call DrawText(TexthDC, Camera.Right - ((Len(Map.Name) \ 2) * 28), Camera.Top + 1, Map.Name, DrawMapNameColor)


Unfortunately I am horrid at properly centering things. This draws the name starting at the left, as opposed to actually centering said text.


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Tue Aug 18, 2009 6:45 pm 
Offline
Newbie

Joined: Tue Aug 11, 2009 11:35 pm
Posts: 4
Quote:
One problem I did notice was that the map name doesn't draw properly--this causes it to just stay where it was on the original sized map.

I fixed it by changing:

Code: Select all
' Draw map name
Call DrawText(TexthDC, DrawMapNameX, DrawMapNameY, Map.Name, DrawMapNameColor)



To:

Code: Select all
' Draw map name
Call DrawText(TexthDC, Camera.Right - ((Len(Map.Name) \ 2) * 28), Camera.Top + 1, Map.Name, DrawMapNameColor)



Unfortunately I am horrid at properly centering things. This draws the name starting at the left, as opposed to actually centering said text.


Anyways it's no a byg deal. In Rpg Maker program happens the same thing, at least those who i tried.

But i'm going to ask one thing.
I Just generated the .exe server and client, enter in the game and changed te map size from propietes of map editor, but the max tile that i could re-size the map was 30x30, it's that correct? or i'm forggoting something?


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Tue Aug 18, 2009 6:54 pm 
Offline
Persistant Poster

Joined: Fri Jun 26, 2009 10:15 pm
Posts: 701
Google Talk: FAProductions
Max is 255x255. I know it works, as I have checked it.

Jacob sent me the fix for the map name a long time ago, I'll look in my email and see if I still have it.


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Tue Aug 18, 2009 7:03 pm 
Offline
Knowledgeable
User avatar

Joined: Wed Jul 26, 2006 11:22 pm
Posts: 143
Location: Virginia, USA
Thanks again. :D I'd much rather have a proper fix than my slapped-together patch.


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Tue Aug 18, 2009 7:08 pm 
Offline
Persistant Poster

Joined: Fri Jun 26, 2009 10:15 pm
Posts: 701
Google Talk: FAProductions
I don't have it, but I'm sure Jacob wouldn't mind posting a fix for it. ;)


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Wed Aug 19, 2009 12:19 am 
Offline
Persistant Poster

Joined: Fri Jun 26, 2009 10:15 pm
Posts: 701
Google Talk: FAProductions
Server side find:

Code:
Sub HandleSaveNPC


Replace the whole sub with:

Code:
Private Sub HandleSaveNpc(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
Dim NpcNum As Long
Dim Buffer As clsBuffer
Dim NpcSize As Long
Dim NpcData() As Byte

    ' Prevent hacking
    If GetPlayerAccess(Index) < ADMIN_DEVELOPER Then
        Call HackingAttempt(Index, "Admin Cloning")
        Exit Sub
    End If
   
    Set Buffer = New clsBuffer

    Buffer.WriteBytes Data()
   
    NpcNum = Buffer.ReadLong
   
    ' Prevent hacking
    If NpcNum < 0 Or NpcNum > MAX_NpcS Then
        Call HackingAttempt(Index, "Invalid Npc Index")
        Exit Sub
    End If
   
    NpcSize = LenB(Npc(NpcNum))
    ReDim NpcData(NpcSize - 1)
    NpcData = Buffer.ReadBytes(NpcSize)
    CopyMemory ByVal VarPtr(Npc(NpcNum)), ByVal VarPtr(NpcData(0)), NpcSize
   
    ' Save it
    Call SendUpdateNpcToAll(NpcNum)
    Call SaveNpc(NpcNum)
    Call AddLog(GetPlayerName(Index) & " saved Npc #" & NpcNum & ".", ADMIN_LOG)
End Sub


I have also already updated the source download.


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Wed Aug 19, 2009 1:18 am 
Offline
Persistant Poster

Joined: Fri Jun 26, 2009 10:15 pm
Posts: 701
Google Talk: FAProductions
Found a bug and can't seem to pinpoint it so if anyone wants to help figure it out, please do.

When you put an npc on the map, it will spawn at first, but if you close the client and login again, it won't be there. However, if you edit the map properties, you will see that the npc is in fact saved and if you save the map again, it will spawn. I just don't understand it. >.<


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Wed Aug 19, 2009 2:35 am 
Offline
Persistant Poster

Joined: Fri Jun 26, 2009 10:15 pm
Posts: 701
Google Talk: FAProductions
Fixed a lot of errors. I suggest you just redownload the source and go from there.


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Thu Sep 03, 2009 3:56 pm 
Offline
Pro
User avatar

Joined: Wed Sep 20, 2006 1:06 pm
Posts: 368
Location: UK
Google Talk: steve.bluez@googlemail.com
Well, I couldn't decide whether to use MS4 or Elysium 3.30. This is some good source. Basic MS4 with scrolling maps and HUGE map sizes is definately a winner for me.

Thanks a hell of a lot Matt (And Jacob, you never fail to impress me)


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Mon Sep 07, 2009 12:03 pm 
Offline
Pro
User avatar

Joined: Wed Sep 20, 2006 1:06 pm
Posts: 368
Location: UK
Google Talk: steve.bluez@googlemail.com
Question: What other features have been added to the source, just the byte arrays and larger maps?

I've also noticed a bug. Not sure if it's because of the larger maps in this source code or if the bug comes from the original MS4. But when you go to place down tiles, it places the tile on the tile to the left of the tile that you click on.
Is there a way to adjust the target tile according to the coordinates of the cursor on the picScreen?


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Mon Sep 07, 2009 1:48 pm 
Offline
Persistant Poster

Joined: Fri Jun 26, 2009 10:15 pm
Posts: 701
Google Talk: FAProductions
Xlithan wrote:
Question: What other features have been added to the source, just the byte arrays and larger maps?

I've also noticed a bug. Not sure if it's because of the larger maps in this source code or if the bug comes from the original MS4. But when you go to place down tiles, it places the tile on the tile to the left of the tile that you click on.
Is there a way to adjust the target tile according to the coordinates of the cursor on the picScreen?


I have been busy with the birth of my son but I should have some time today to open up the source and check. I think I know the problem, but I can't remember off hand what it was. Is this only when you resize the map or is it even on a base size?


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Mon Sep 07, 2009 2:01 pm 
Offline
Pro
User avatar

Joined: Wed Sep 20, 2006 1:06 pm
Posts: 368
Location: UK
Google Talk: steve.bluez@googlemail.com
I will double check that for you Matt

Edit: It may well have been caused by increasing the width/height of picScreen


Top
 Profile  
 
 Post subject: Re: MS4
PostPosted: Mon Sep 07, 2009 2:39 pm 
Offline
Persistant Poster

Joined: Fri Jun 26, 2009 10:15 pm
Posts: 701
Google Talk: FAProductions
Xlithan wrote:
I will double check that for you Matt

Edit: It may well have been caused by increasing the width/height of picScreen


Okay. I'll play with that when I get the chance. I'm sure it's a simple as a variable needing to be changed. Hopefully. Lol.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 44 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 13 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group