Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - alexgleason

Pages: [1] 2 3 ... 6
Your projects / Re: Children of Solarus [official thread]
« on: December 12, 2018, 02:04:23 am »
Is the story the same as zsdx but with original characters instead?

Your projects / Re: Vegan on a Desert Island
« on: December 09, 2018, 08:04:59 pm »
We're now on the Solarus Discord at #voadi. I post daily updates about my progress, so feel free to follow along!

You can also join via Matrix at

General discussion / Re: We have moved
« on: December 09, 2018, 03:10:26 pm »
Hey everyone, we just successfully bridged 3 rooms with Matrix. So if you'd like to join that way, it's now an option: community page.

If anyone would like other rooms bridged just shout out here or in #solarus

Development / Re: How do you organize your quest data files?
« on: December 07, 2018, 12:46:36 am »
Thanks so much for writing this out! This exactly the type of info I was hoping for. ;D

Development / How do you organize your quest data files?
« on: December 06, 2018, 11:11:09 pm »
Here's how badly disorganized I am:

It's becoming an actual blocker for me. I'm afraid to create new maps and experiment because I don't want to worsen to this mess.

I may solve this by writing documentation on how Vegan on a Desert Island's files are organized. But I'm curious if anyone has already done this, or has any insight to offer.

Some parts I'd like to cover:

  • Dialogs - when do you create folders? Do you categorize by area, by character, by time period? How do you organize branching dialog?
  • Maps - same as above.
  • Sprites - when do you create new a sprite sheet? what is the folder structure?
  • Scripts - same as above.

General discussion / Re: We have moved
« on: December 04, 2018, 04:54:03 pm »
I just discovered there's an active third-party bridge tool for Discord <--> Matrix:

Would anyone be interested in setting this up with me? How many channels does the Discord have?

Development / Re: Lua promises
« on: December 03, 2018, 11:14:11 pm »
Hi Greg,

Wow, thank you! This is extremely cool - I'm glad you've already solved it. ;D I'm still on 1.5.3 but will have to check out 1.6.

No worries about 1.7 being far away. If there's anything I really need before launch I can edit the engine myself (hooray open source!) Thanks so much for your work on Solarus.


Your projects / Re: Some Maps I've been working on...
« on: December 03, 2018, 10:13:32 pm »
I like the map. I see what you're going for. I like the concept of a large town with two broad paths bisecting it. It reminds me of Clock Town. You could probably improve it by making each of the quadrants distinct.

North Clocktown is basically a big park. Nature is important.
East Clocktown has city-related stuff like the mayor's office and inns.
West Clocktown has shops. Gotta get your goods from somewhere.
South Clocktown is the hustle and bustle of the city. It's the main entrance to the city, has signs that say "welcome to Clock Town", and a giant monument the city is known for right in the center.

So what's your story? Consider treating it like fanfic for a minute.

On another note, you could add more variety to the map by having an extra level of elevation.

Development / Re: Lua promises
« on: December 03, 2018, 08:19:51 pm »
True, you could avoid nesting callbacks by timing the animations correctly, but at the cost of a harder-to-maintain codebase.

Development / Lua promises
« on: December 03, 2018, 06:24:02 pm »
I've been working on animating an intro sequence for my game, and running into callback hell with movements. Eg, one movement must happen, then the next movement happens, then a timer happens, then another movement happens, etc.

I found a few Lua promise libraries:

The top one looks very promising. Anyone have experience with this? Also just wanted to share in case others find it interesting.

Your scripts / Re: Dialog Box script with Name Displayed
« on: November 23, 2018, 07:27:30 pm »
This is very cool! Thanks for sharing. I might use this.

Your projects / Re: Some Maps I've been working on...
« on: November 16, 2018, 11:18:57 pm »
Looks nice! I need to improve my mapping skills.

As a side question, how do maps of this size perform? Especially curious for less powerful hardware like Android phones.

Since each entity's "on_created" function gets called when the map loads, I'm guessing Solarus loads the entire map into memory at once (as opposed to rendering only the viewport, for example).

Your scripts / "End Credits" script (rolling credits)
« on: November 15, 2018, 09:54:14 pm »
I didn't share this before because it'd likely need to be adapted and parts of the code aren't super nice, but I figure maybe this will benefit someone.

It requires a dialog called "end_credits", and it just rolls through it until it's done.
Code: Lua
  1. -- ♡ Copying is an act of love. Please copy and share.
  3. -- Game credits. Plays at the end of the game.
  5. local end_credits = {}
  8. --
  9. function build_array(...)
  10.   local arr = {}
  11.   for v in ... do
  12.     arr[#arr + 1] = v
  13.   end
  14.   return arr
  15. end
  18. -- Called when the menu is started
  19. function end_credits:on_started()
  20.   local lh = 12 -- line height in pixels
  21.   local speed = 24 -- scroll speed in px/s
  23.   -- Credits dialog
  24.   self.dialog = sol.language.get_dialog("end_credits")
  26.   -- Break dialog text into a table of lines
  27.   local lines = self.dialog.text
  28.   lines = lines:gsub("\r\n", "\n"):gsub("\r", "\n")
  29.   lines = build_array(lines:gmatch("([^\n]*)\n"))
  32.   -- Box where the credits go
  33.   self.credits_surface = sol.surface.create(
  34.     160, -- center the surface on the screen
  35.     (#lines * lh) -- surface is large enough to hold all lines
  36.       + 144 -- surface scrolls in from the bottom, so has a padding top equal to the screen size
  37.       + 16 -- room for 8px top and bottom padding
  38.   )
  40.   -- Loop through all dialog lines and draw them
  41.   for i, line in ipairs(lines) do
  42.     local line_surface =  sol.text_surface.create({font="Comicoro", font_size=16, text=line})
  43.     -- Draw the given line
  44.     line_surface:draw(
  45.       self.credits_surface,
  46.       8, -- left padding
  47.       i * lh -- bump it down by line number and line height
  48.         + 8 -- top padding for whole box
  49.     )
  50.   end
  52.   -- Animate the text box upwards
  53.   local m = sol.movement.create("straight")
  54.   m:set_angle(math.pi / 2)
  55.   m:set_speed(speed)
  56.   m:start(self.credits_surface)
  58.   function m:on_position_changed()
  59.     local credits_surface = end_credits.credits_surface
  60.     local x, y = credits_surface:get_xy()
  61.     local w, h = credits_surface:get_size()
  63.     log(string.format("Credits text box: (%d, %d)  ;;  y+h = %d", x, y, y+h))
  65.     if y + h < 0 then
  66.       -- Credits are out of view, end the menu
  67.       log("Credits animation finished.")
  68.       self:stop()
  70.     end
  71.   end
  73. end
  76. -- Called each frame
  77. function end_credits:on_draw(dst_surface)
  78.   dst_surface:clear()
  79.   self.credits_surface:draw(dst_surface, 48, 144)
  80. end
  83. return end_credits

It's a menu, so put it in a .lua file (eg scripts/menus/end_credits.lua) and use something like this:

Code: Lua
  1. local end_credits = require("scripts/menus/end_credits")
  3., end_credits)

General discussion / How loud should sounds be?
« on: November 04, 2018, 05:50:11 pm »
One thing I don't quite understand, is how loud to make each of my sounds/music so it meets the user's expectation based on the volume they've set on their computer.

For example, sometimes I'll mute my game while working and be listening to other music. Then when I unmute my game, I have to turn the volume down. This is because the music in my game is louder than the other music I'm listening to. The other music is usually an album played with VLC, or a YouTube video.

I'm aware of "the loudness wars." Where did we ever end up with that? Is there any sort of standard for loudness? Ideally, I want users to not have to turn the volume up or down when switching from other software to my game.

General discussion / Re: Need Help With Enemy Scripting
« on: November 03, 2018, 09:46:33 pm »
A really simple hack to make it go only left/right might be like this:

Code: Lua
  1. function enemy:go(direction4)
  2.   -- prevent this function from working for north/south movement
  3.   if direction4 == 1 or direction4 == 3 then
  4.     return
  5.   end
  7.   -- rest of function is below

Point is, make the "go" function not do anything if the direction it would move is up (1) or down (3).

For direction4:
East = 0
North = 1
West = 2
South = 3

Pages: [1] 2 3 ... 6