Menu

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.

Show posts Menu

Messages - alexgleason

#46
General discussion / Re: We have moved
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:


+solarus:matrix.org community page.

If anyone would like other rooms bridged just shout out here or in #solarus
#47
Thanks so much for writing this out! This exactly the type of info I was hoping for. ;D
#48
Development / How do you organize your quest data files?
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.
#49
General discussion / Re: We have moved
December 04, 2018, 04:54:03 PM
I just discovered there's an active third-party bridge tool for Discord <--> Matrix: https://t2bot.io/discord

Would anyone be interested in setting this up with me? How many channels does the Discord have?
#50
Development / Re: Lua promises
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.

Alex
#51
Your projects / Re: Some Maps I've been working 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.
#52
Development / Re: Lua promises
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.
#53
Development / Lua promises
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.
#54
Your scripts / Re: Dialog Box script with Name Displayed
November 23, 2018, 07:27:30 PM
This is very cool! Thanks for sharing. I might use this.
#55
Your projects / Re: Some Maps I've been working 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).
#56
Your scripts / "End Credits" script (rolling credits)
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) Select
-- ♡ Copying is an act of love. Please copy and share.

-- Game credits. Plays at the end of the game.

local end_credits = {}


-- https://stackoverflow.com/a/8316375/8811886
function build_array(...)
  local arr = {}
  for v in ... do
    arr[#arr + 1] = v
  end
  return arr
end


-- Called when the menu is started
function end_credits:on_started()
  local lh = 12 -- line height in pixels
  local speed = 24 -- scroll speed in px/s

  -- Credits dialog
  self.dialog = sol.language.get_dialog("end_credits")

  -- Break dialog text into a table of lines
  local lines = self.dialog.text
  lines = lines:gsub("\r\n", "\n"):gsub("\r", "\n")
  lines = build_array(lines:gmatch("([^\n]*)\n"))


  -- Box where the credits go
  self.credits_surface = sol.surface.create(
    160, -- center the surface on the screen
    (#lines * lh) -- surface is large enough to hold all lines
      + 144 -- surface scrolls in from the bottom, so has a padding top equal to the screen size
      + 16 -- room for 8px top and bottom padding
  )

  -- Loop through all dialog lines and draw them
  for i, line in ipairs(lines) do
    local line_surface =  sol.text_surface.create({font="Comicoro", font_size=16, text=line})
    -- Draw the given line
    line_surface:draw(
      self.credits_surface,
      8, -- left padding
      i * lh -- bump it down by line number and line height
        + 8 -- top padding for whole box
    )
  end

  -- Animate the text box upwards
  local m = sol.movement.create("straight")
  m:set_angle(math.pi / 2)
  m:set_speed(speed)
  m:start(self.credits_surface)

  function m:on_position_changed()
    local credits_surface = end_credits.credits_surface
    local x, y = credits_surface:get_xy()
    local w, h = credits_surface:get_size()

    log(string.format("Credits text box: (%d, %d)  ;;  y+h = %d", x, y, y+h))

    if y + h < 0 then
      -- Credits are out of view, end the menu
      log("Credits animation finished.")
      self:stop()
      sol.menu.stop(end_credits)
    end
  end

end


-- Called each frame
function end_credits:on_draw(dst_surface)
  dst_surface:clear()
  self.credits_surface:draw(dst_surface, 48, 144)
end


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) Select

local end_credits = require("scripts/menus/end_credits")

sol.menu.start(game, end_credits)
#57
General discussion / How loud should sounds be?
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.
#58
General discussion / Re: Need Help With Enemy Scripting
November 03, 2018, 09:46:33 PM
A really simple hack to make it go only left/right might be like this:

Code ( lua) Select
function enemy:go(direction4)
  -- prevent this function from working for north/south movement
  if direction4 == 1 or direction4 == 3 then
    return
  end

  -- 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
#59
There are C++ to ES6 transpilers that seem to work reasonably well, like Emscripten: http://kripken.github.io/emscripten-site/

For example, you can see the open source game FreeDink running in the browser: https://play.freedink.org/ This game is written in C++ and ported to the web with Ecmascripten.

I think Solarus would have to be modified for this to work since it reads the filesystem to load the quest and write save data, but it might be possible.
#60
General discussion / Puzzle design
November 01, 2018, 03:48:52 PM
I've seen some great resources here about creating beautiful maps, but what about designing puzzles? How do you even approach designing something that you yourself should not be able to easily solve?

I've found one great video series, starting here: https://www.youtube.com/watch?v=4YpQVdZOjgI

Curious if others have any more input or resources.