Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EA] MiniMap


Ertzel
 Share

Recommended Posts

I changed it in my version for Eclipse Mega so it stores the NPC and Event data like the code in that quote by me. Then it doesn't do the calculations every time it draws the map, only when the NPC or event is updated.

I didn't change it for players though because the way I have players setup is they only display party members that are on your same map, no one else.

I might update this tutorial using the reduced memory version when I have time later.
Link to comment
Share on other sites

  • Replies 73
  • Created
  • Last Reply

Top Posters In This Topic

Yes, he means store the data in a UDT somewhere until it needs to be changed instead of re-calculating the positions every time the minimap updates… if you wanna be that picky then write it yourself there is no need to complain about it here, the performance hit is minimal at best.
Link to comment
Share on other sites

> Yes, he means store the data in a UDT somewhere until it needs to be changed instead of re-calculating the positions every time the minimap updates… if you wanna be that picky then write it yourself there is no need to complain about it here, the performance hit is minimal at best.

I'm not using this JC, nor am i bitching about it.

I'm just giving him advice on how to improve the existing code to be more efficient, is there something wrong with that?

One thing may seem insignificant at first, but a ton of poorly optimized features will slow down any project quickly.
Link to comment
Share on other sites

Hey ertz do you know that you can make this only with white.png texture what is located in misc folder and with DX8 recoloring? ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png) its only thought but it is possible
Link to comment
Share on other sites

here's the minimap image without the pink background if someone want's to use it (it's a .png image with transparent background)

![](http://www.freemmorpgmaker.com/files/imagehost/pics/fbf0a9c45fbb6655196f0525ef2490ac.png)

URL for the image: [http://www.freemmorpgmaker.com/files/imagehost/pics/fbf0a9c45fbb6655196f0525ef2490ac.png](http://www.freemmorpgmaker.com/files/imagehost/pics/fbf0a9c45fbb6655196f0525ef2490ac.png)

Ertzel, add to the first message if you want ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)
Link to comment
Share on other sites

Updated the original post with a re-done version of the tutorial. Now player x/y values are stored and only calculated when needed and same with npc x/y values. Also removed the need for the graphics image and used Death's suggestion of just the white square and editing the color through DX8.

New Color Codes are

Event With Name = Yellow

Event Without Name = Dark Blue

Default tile = White

Block Tile = Red

Warp Tile = Purple

Item Tile = Green

PK Player = Dark Red

Non-PK = Light Green

NPC Attack On Sight = Black

NPC ATtack When Attacked = Dark Purple

NPC SHopkeeper = Orange

NPC Friendly = Pink

NPC Guard = Light Blue

And a example of how it now looks ![](http://www.freemmorpgmaker.com/files/imagehost/pics/cf2831ecd53f42a5b77bf30028c174ed.png)
Link to comment
Share on other sites

If you mean when you play around with resolutions in Dragon Eclipse, that would be because its probably drawn off-screen on any other resolution.

You would have to do this:

At the top of```
DrawMiniMap()
```add```

Dim CameraXSize As Long, CameraYSize As Long

CameraXSize = frmMain.Width - (frmMain.Width - 780)

```

Then replace everything that says```

CameraX = 780 -

```with```

CameraX = CameraXSize -

```

That way it calculates the X based off your frmMain width instead of a static number.

I updated the original post with this change since it makes sense for all versions and will help people with Dragon Eclipse,
Link to comment
Share on other sites

> Glad to see you took my advice, have a cookie.
>
> ![](http://thinkprogress.org/wp-content/uploads/2011/04/cookie.gif)

shoulda been an oreo…. Also it works perfectly but it cuts the framerate in half. just make sure to add a button in options to disable the minimap on slower pcs.
Link to comment
Share on other sites

Ya, I was going to make an option in the option window but its annoying to edit options due to my failed photo-editing option to edit the picture. If someone wants to upload the 21.png file with MiniMap and the On/Off buttons below Debug, I'll add how to put in the new option into the tutorial.
Link to comment
Share on other sites

Just make a checkbox just like all the other options in pic options ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png) and i added a new tiletyp thats exactly the same as a blocked tile except its called water and shows up blue on the minimap, looks pretty cool lol. thx for the tut
Link to comment
Share on other sites

Render the minimap once to a buffer, and continue rendering that buffer until you have the need to change (ie, when you switch maps). Just doing it in an array looping like the tiles is rather unweildy.

If you really need to show the positions of other players/NPCs, then that can at least be rendered as it is.
Link to comment
Share on other sites

> If you mean when you play around with resolutions in Dragon Eclipse, that would be because its probably drawn off-screen on any other resolution.
>
> You would have to do this:
>
> At the top of```
> DrawMiniMap()
> ```add```
>
> Dim CameraXSize As Long, CameraYSize As Long
>
> CameraXSize = frmMain.Width - (frmMain.Width - 780)
>
> ```
>
> Then replace everything that says```
>
> CameraX = 780 -
>
> ```with```
>
> CameraX = CameraXSize -
>
> ```
>
> That way it calculates the X based off your frmMain width instead of a static number.
>
> I updated the original post with this change since it makes sense for all versions and will help people with Dragon Eclipse,

Doesn't work, tried this then tried to re-do the main tutorial.
Link to comment
Share on other sites

find this```
' Render the minimap

DrawMiniMap

```and replace it with something like this```
if chkmap.value = false then

drawminimap

end if
```that was the mini map is on by deafult. you gotta make a checkbox called chk map to use it tho.
Link to comment
Share on other sites

  • 2 weeks later...
how to Fix this?

Error desc = Medhod or data member not found

' Draw Tile Attribute

For x = 0 To MapX

For y = 0 To MapY

For I = 1 To Map**.CurrentEvents**

If Map.MapEvents(I).visible = 1 Then

If Map.MapEvents(I).x = x Then

If Map.MapEvents(I).y = y Then

CameraX = CameraXSize - (MapX * 4) + (x * 4)

CameraY = 55 + (y * 4)

Select Case Map.MapEvents(I).ShowName

Case 0 ' Tile

RenderTexture Tex_White, CameraX, CameraY, EventTileRect.Left, EventTileRect.Top, EventTileRect.Right - EventTileRect.Left, EventTileRect.Bottom - EventTileRect.Top, EventTileRect.Right - EventTileRect.Left, EventTileRect.Bottom - EventTileRect.Top, D3DColorRGBA(0, 0, 155, 200)

Case 1 ' Sprite

RenderTexture Tex_White, CameraX, CameraY, EventNpcRect.Left, EventNpcRect.Top, EventNpcRect.Right - EventNpcRect.Left, EventNpcRect.Bottom - EventNpcRect.Top, EventNpcRect.Right - EventNpcRect.Left, EventNpcRect.Bottom - EventNpcRect.Top, D3DColorRGBA(255, 255, 0, 200)

End Select
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×
×
  • Create New...