Hey, we have forums!

Author Topic: World Maps in Mods (Beta Testers Wanted)  (Read 29137 times)

0 Members and 1 Guest are viewing this topic.

Offline Edwards

  • Bit Bit
  • ****
  • Posts: 93
    • View Profile
World Maps in Mods (Beta Testers Wanted)
« on: December 21, 2009, 08:18:11 am »
After a couple days of coding (and several weeks of design work in the few minutes I had free), I have a functional replacement for Aquaria's world map feature.  If you double-click on the little minimap in the corner, the game will pause, and a full-screen world map will appear, with only the maps you've explored visible, and with little icons for items you have found (savepoints, turtles, etc.).  Click in the corner again, and the map will vanish and the game will unpause.

Demo link: here (172 kB) (Version 3)

I tried to make it as simple as possible to add a world map to a mod.  All that should be needed is to:
1) Add three scripts to your mod
2) create world map tiles from your maptemplate images
3) Change one of the scripts to list all of your maps, their relative positions, and the positions of any connecting passages (if you want them marked).  This isn't as obnoxious as it sounds, actually.
4) Change any scripts from the default game that use the pickupGem function to use one of my replacement map gem functions.
5) Add one node to each of your maps.

I'll try to write up detailed instructions for this tomorrow.  Note: I would recommend not trying to integrate this into any mods until I've gotten some more bugs ironed out.

----------
Outstanding issues (any suggestions for dealing with these would be appreciated): (Checked-off items have been fixed)
√) Hitting escape while the map is open will lock up the game for 1-2 days.
2) The map appears below layers 8, 9, and the shadow layer.
3) Clicking on the minimap does not produce that expanding ripple effect.
4) There is no ability to zoom in or out on the world map.
√) All internal documentation refers to "minimap" not "world map"- I only changed the naming convention I'm using a few minutes ago.

- Edwards


« Last Edit: December 23, 2009, 12:35:58 am by Edwards »
You should only need one canister shell to bag your deer using your howitzer, but assemble more than one if  you have a mind to.1

Offline Hiro

  • Hero Bit
  • *********
  • Posts: 674
  • Kriel's Legionary
    • View Profile
    • The Rat Hole
Re: A small project
« Reply #1 on: December 21, 2009, 09:14:01 am »
...Are you...carrying... that seahorse...?

Duuuuuude...
My site is: http://www.therathole.co.nr/
Where I put pictures and blog posts and stuff..

Offline Alphasoldier

  • Dream Bit
  • **********
  • Posts: 1810
  • Zero Suit!
    • View Profile
Re: A small project
« Reply #2 on: December 21, 2009, 11:49:57 am »
Hiro, I'll take that as a joke, cause I think Edwards was showing us a FUNCTIONAL Mini Map.
This would be epic indeed, I've thought about this a few times myself, and had thought to maybe load the mod when you start the game by switching the Title Screen map load by the mod, and look if the mini map would work, but I've been too lazy to try.

Awesome work though!
God sees and knows everything, but at least he won't gossip about it.

Offline Edwards

  • Bit Bit
  • ****
  • Posts: 93
    • View Profile
Re: A small project
« Reply #3 on: December 22, 2009, 05:52:08 am »
...Are you...carrying... that seahorse...?

Duuuuuude...
The seahorse was actually completely incidental- a remnant of an earlier method of activating the map.  However, carrying a seahorse would be really cool- I'm just not sure if it would fit better in the inventory-based Li Mod, or a Comrade Seahorse mod ("in Soviet Russia, seahorse rides you!").

Hiro, I'll take that as a joke, cause I think Edwards was showing us a FUNCTIONAL Mini Map.
Exactly.  I'm not entirely sure about the feasibility of what you suggested- I just did a lot of work with carefully-positioned quads, and some really fun stuff with designing data structures to hold/hide the map information.  Anyway, I've posted a demo of what I have (see the first post).  I'd appreciate it if people would try it out and report any graphical anomalies and crashes, particularly if they're running on Windows, or like to play in widescreen mode (I've mostly been testing in 4:3 resolutions).

Finally, I'd like to thank Alec for leaving in (probably unintentionally) the framework for persistent storage of arbitrary data structures, by means of the setStringFlag/getStringFlag functions.  String flags really look like afterthoughts, being only used for a couple minor tasks in the editor demo, but I'd call them one of the most powerful mod-design tools available.  Simply put, they allow for storing almost any type of data across different entities, map changes, and even save/reloads- I'm using them to store most of the little icons that appear on the map.

- Edwards
« Last Edit: December 22, 2009, 07:35:47 am by Edwards »
You should only need one canister shell to bag your deer using your howitzer, but assemble more than one if  you have a mind to.1

Offline Chibi

  • Dream Bit
  • **********
  • Posts: 1443
  • Deus Ex Aquaria
    • View Profile
    • Prize Rebel ($50 dollars earned in two months)
Re: A small project
« Reply #4 on: December 22, 2009, 07:13:57 am »
Finally, I'd like to thank Alec for leaving in (probably unintentionally) the framework for persistent storage of arbitrary data structures, by means of the setStringFlag/getStringFlag functions.  String flags really look like afterthoughts, being only used for a couple minor tasks in the editor demo, but I'd call them one of the most powerful mod-design tools available.  Simply put, they allow for storing almost any type of data across different entities, map changes, and even save/reloads.

- Edwards
I won't pretend to understand what you just said, but thanks for figuring out the mini-map.  :)

Life is a sexually transmitted disease with a 100% mortality rate. [Click the signature for +1 health!]

Offline Hiro

  • Hero Bit
  • *********
  • Posts: 674
  • Kriel's Legionary
    • View Profile
    • The Rat Hole
Re: World Maps in Mods (Beta Testers Wanted)
« Reply #5 on: December 22, 2009, 09:19:23 am »
Hahaha. I posted my comment when the opening post only said "I'm working on something cool" (not in those words of course) and it only had the top screenshot.
I didn't even click that as a mod it shouldn't have a minimap. XD
My site is: http://www.therathole.co.nr/
Where I put pictures and blog posts and stuff..

Offline TheBear

  • Extra Bit
  • *****
  • Posts: 199
    • View Profile
    • http://doconnell.wordpress.com
Re: World Maps in Mods (Beta Testers Wanted)
« Reply #6 on: December 22, 2009, 04:54:48 pm »
Really awesome work, Edwards. It works fine the first time but crashes on me the second time I to open the minimap (tried on widescreen and regular). Nothing of note in the debugLog but "setting up map" is the last thing that gets output.

Offline Edwards

  • Bit Bit
  • ****
  • Posts: 93
    • View Profile
Re: World Maps in Mods (Beta Testers Wanted)
« Reply #7 on: December 22, 2009, 08:18:55 pm »
Really awesome work, Edwards. It works fine the first time but crashes on me the second time I to open the minimap (tried on widescreen and regular). Nothing of note in the debugLog but "setting up map" is the last thing that gets output.
What exactly do you mean by "crashes"?  Quits to the desktop, freezes, freezes with black screen?  Are you testing in fullscreen or windowed mode?

Anyway, try this version: link.
I haven't made any changes to the code, I just added some more granularity to the debug messages in the map set-up.

- Edwards
You should only need one canister shell to bag your deer using your howitzer, but assemble more than one if  you have a mind to.1

Offline TheBear

  • Extra Bit
  • *****
  • Posts: 199
    • View Profile
    • http://doconnell.wordpress.com
Re: World Maps in Mods (Beta Testers Wanted)
« Reply #8 on: December 22, 2009, 08:59:13 pm »
Quote
Clearing map
Deleting quads
Finished clearing map
UNLOADING TEXTURE: mmaps/mapbg
UNLOADING TEXTURE: mmaps/mul
Left mouse down
Left mouse up
Left mouse down
Left mouse up (launching map)
Setting up map
Adjusting zoom

It gives me a Windows error stating the program has encountered an error and crashes to desktop after hitting okay (this is on opening minimap the second time). Repeat crash regardless of screen resolution or windowed/fullscreen.
« Last Edit: December 22, 2009, 09:04:26 pm by TheBear »

Offline Edwards

  • Bit Bit
  • ****
  • Posts: 93
    • View Profile
Re: World Maps in Mods (Beta Testers Wanted)
« Reply #9 on: December 22, 2009, 09:24:00 pm »
Quote

Setting up map
Adjusting zoom
It gives me a Windows error stating the program has encountered an error and crashes to desktop after hitting okay (this is on opening minimap the second time). Repeat crash regardless of screen resolution or windowed/fullscreen.
Lovely.  It looks like it's crashing on one of the two most innocuous function calls in the script.  Have you ever run into problems from repeated calls to overrideZoom()?

Regardless, try commenting out the line wait(0.5) in minimapper.lua's setUpMap function (line 178, about half-way down the script).  I'm guessing that something weird is going on with another script during the half second I'm waiting for the zoom to finish.  If so, I'll solve this completely in the next version (I hope) as I intend to stop zooming in entirely.

- Edwards
« Last Edit: December 22, 2009, 09:26:33 pm by Edwards »
You should only need one canister shell to bag your deer using your howitzer, but assemble more than one if  you have a mind to.1

Offline TheBear

  • Extra Bit
  • *****
  • Posts: 199
    • View Profile
    • http://doconnell.wordpress.com
Re: World Maps in Mods (Beta Testers Wanted)
« Reply #10 on: December 22, 2009, 11:03:41 pm »
It doesn't crash with wait(0.5) commented out although the minimap graphics are a bit offset. I know that wait() isn't the most stable of functions but it continued to crash when I tried watch(). I've been working on a map for Sacrifice where I have an entity calling overrideZoom() every update() with nodes calling overrideZoom() on top of that when the entity is inside a specific node and it works fine.

Offline Edwards

  • Bit Bit
  • ****
  • Posts: 93
    • View Profile
Re: World Maps in Mods (Beta Testers Wanted)
« Reply #11 on: December 22, 2009, 11:45:15 pm »
It doesn't crash with wait(0.5) commented out although the minimap graphics are a bit offset.
Yeah.  Unfortunately, the getWindowCenter() function doesn't actually return the center of the window correctly when the map is zooming in (it seems to be about one frame behind), so I was trying to wait until the zoom had finished before finding out where the window was.  I might be able to do something with the mouse coordinates, though- just move the mouse to the center of the window, get the world coordinates, and move it back to where it was.

[Addendum] The above method works, sort of- I think it's a hair better than getWindowCenter(), but it's also slightly off.  I still want to get rid of zooming entirely, though- I just want to clear up the problem of the map not always appearing on top first.

[Addendum 2] Or I could just have the map use the center-of-screen that I'm already getting every update after the screen stabilizes because of the pause.  I was already using it for everything but the background and the Naija gem, and now everything is working perfectly.  Link to new wait-free version here: link

I know that wait() isn't the most stable of functions but it continued to crash when I tried watch(). I've been working on a map for Sacrifice where I have an entity calling overrideZoom() every update() with nodes calling overrideZoom() on top of that when the entity is inside a specific node and it works fine.
Well, nice to know that overrideZoom() abuse is safe.
« Last Edit: December 22, 2009, 11:47:15 pm by Edwards »
You should only need one canister shell to bag your deer using your howitzer, but assemble more than one if  you have a mind to.1

Offline Dolphin's Cry

  • Bit Bit
  • ****
  • Posts: 61
    • View Profile
Re: A small project
« Reply #12 on: December 23, 2009, 05:19:28 pm »
Finally, I'd like to thank Alec for leaving in (probably unintentionally) the framework for persistent storage of arbitrary data structures, by means of the setStringFlag/getStringFlag functions.  String flags really look like afterthoughts, being only used for a couple minor tasks in the editor demo, but I'd call them one of the most powerful mod-design tools available.  Simply put, they allow for storing almost any type of data across different entities, map changes, and even save/reloads- I'm using them to store most of the little icons that appear on the map.
Nice, I'd noticed those two functions and the possibilities they offer, but I never got around to actually testing them. ;)

I've been working on something myself, it's not a mod, but... well, I hope I have a bit more to tell after the holidays. By the way, is the IRC channel still in use?
Can you hear the dolphin's cry?

Offline Yogoda

  • Extra Bit
  • *****
  • Posts: 144
    • View Profile
Re: World Maps in Mods (Beta Testers Wanted)
« Reply #13 on: January 04, 2010, 08:28:39 pm »
It is possible to upload you mod elsewhere ?

Keep having this message : Currently a lot of users are downloading files. Please try again in 2 minutes or become a Premium member.

Offline Yogoda

  • Extra Bit
  • *****
  • Posts: 144
    • View Profile
Re: World Maps in Mods (Beta Testers Wanted)
« Reply #14 on: January 05, 2010, 08:59:56 am »
Ok, I have been able to download it, had to do it early in the morning, when I come back from work it is not possible.