Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 45 46 [47] 48 49 ... 90

Author Topic: BoundWorlds: An action-adventure game with an insanely powerful level editor  (Read 149061 times)

MoonyTheHuman

  • Bay Watcher
  • I think the DEC VAX hates me.
    • View Profile
    • hellomouse
Re: BoundWorlds Open Alpha - Explore the Multiverse and build a world!
« Reply #690 on: January 04, 2018, 12:38:16 am »

IndigoFenix, my temptation to try and help out and/or just dive into your code has taken over.
I'm gonna poke at your code (which is obviously handwritten javascript, it still has your comments haha) and give you my recommendations.
If you don't want that, just say so and i'll stop poking around.
You've done amazing work writing this.

Edit: My early findings:
You should probably split this into multiple files, large code like this is hard to read for both me and you (Unless index.js is just a bundle, then it's fine because it's made by a computer :P)
Avoid Math.js's expression parsing. It executes arbitrary code on the client (as in, eval()); and a friend and I proved a while ago that it can be used to execute truly arbitrary code (Bypassing it's protections). With the new x86 bugs around, this is an even bigger issue.
It also seems like you're switching styles a lot. You use 'class', prototypes, and everything in between for making new object types.

Yup. I'm a walking style guide. But i recommend this to help you as a programmer, as well. :)
« Last Edit: January 04, 2018, 12:57:46 am by MoonyTheHuman »
Logged

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: BoundWorlds Open Alpha - Explore the Multiverse and build a world!
« Reply #691 on: January 04, 2018, 03:21:37 am »

What you're looking at is several years worth of on-and-off writing, so yeah some older code may be different.  Javascript classes didn't even exist when I started.

I don't actually use eval(), I wrote my own expression system for this very reason.  Also to use the in-game variable system which is internally somewhat different than Javascript.

I suppose I could split up the code somewhat.  I mostly keep it together to make editing different parts of it at once easier.

I wasn't planning on making this true open source, but if you want to help out I'll take it and acknowledge it.  Sidescrolling to top-down physics boundaries is particularly annoying...

MoonyTheHuman

  • Bay Watcher
  • I think the DEC VAX hates me.
    • View Profile
    • hellomouse
Re: BoundWorlds Open Alpha - Explore the Multiverse and build a world!
« Reply #692 on: January 04, 2018, 03:31:51 am »

Just to clarify, i wasn't saying you used eval, i was saying math.js, which you have in your scripts, does.

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: BoundWorlds Open Alpha - Explore the Multiverse and build a world!
« Reply #693 on: January 04, 2018, 05:23:40 am »

Wait, you mean stuff like Math.floor can be used to execute arbitrary code?  That's news to me.

MoonyTheHuman

  • Bay Watcher
  • I think the DEC VAX hates me.
    • View Profile
    • hellomouse
Re: BoundWorlds Open Alpha - Explore the Multiverse and build a world!
« Reply #694 on: January 04, 2018, 01:20:28 pm »

No. You have math.js the third-party library bundled. It has a mathematical expression parser that executes arbitary code.

Kamani

  • Bay Watcher
  • Hello hello hello!
    • View Profile
Re: BoundWorlds Open Alpha - Explore the Multiverse and build a world!
« Reply #695 on: January 04, 2018, 02:46:38 pm »

I'm attempting to make a puzzle (not a very creative one, but I am pretty new at puzzle making). I am trying to make one of those tile grid puzzles where turning a tile on or off also switches whether its neighboring tiles are on or off. So, is there an easy way to set a variable on every object in a radius (or some other easy way to do this), or do I just have to set up each one individually?
Logged
Boundworlds: A Multiverse Creation and Exploration Action RPG
Good if you can't focus on a single project long enough to make a full game. Or for making an entire large game, if you feel like it.

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: BoundWorlds Open Alpha - Explore the Multiverse and build a world!
« Reply #696 on: January 04, 2018, 04:17:52 pm »

This should be possible.  The _tileprops object also returns an array of all sprites touching the tile (variable _sprites).  To iterate through the array, use an Each loop.  Using this, you should be able to 1 identify the tile(s) adjacent to the sprite, 2 for Each tile._sprites, and 3 if #._name = "tileclassname" do whatever.

Protea's coming along nicely.  I'll probably open it up once the first dungeon is complete, because at that point it will be possible to save your progress.  After that I'll probably work on either partitions or status effects.  But BoundWorlds needs more content for now.

Kamani

  • Bay Watcher
  • Hello hello hello!
    • View Profile
Re: BoundWorlds Open Alpha - Explore the Multiverse and build a world!
« Reply #697 on: January 04, 2018, 10:25:17 pm »

Protea?
Logged
Boundworlds: A Multiverse Creation and Exploration Action RPG
Good if you can't focus on a single project long enough to make a full game. Or for making an entire large game, if you feel like it.

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: BoundWorlds Open Alpha - Explore the Multiverse and build a world!
« Reply #698 on: January 05, 2018, 01:07:32 am »

My first world from the old version of BoundWorlds.  Of course, it's being updated significantly, with stuff like a combat system.  Also there's a bug catching system which will probably be put in a public package.  Could be upgraded to a whole monster catching thing actually.

Kamani

  • Bay Watcher
  • Hello hello hello!
    • View Profile
Re: BoundWorlds Open Alpha - Explore the Multiverse and build a world!
« Reply #699 on: January 05, 2018, 07:31:52 am »

Cool! Sounds neat.

Edit: Amusing thing you can do it edit mode: click on yourself and edit your own stats. I messed with super jumps earlier.

Edit: Could you explain how to use identify the tile(s) adjacent to a sprite with _tileprops in a bit more detail? The rest of it made sense to me, but that part leaves me a bit confused.
« Last Edit: January 05, 2018, 09:04:05 am by Kamani »
Logged
Boundworlds: A Multiverse Creation and Exploration Action RPG
Good if you can't focus on a single project long enough to make a full game. Or for making an entire large game, if you feel like it.

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: BoundWorlds Open Alpha - Explore the Multiverse and build a world!
« Reply #700 on: January 05, 2018, 09:28:28 am »

If you look at the object viewer, some variables are shown as lists of objects in brackets.  For example, _room._layers, _layer._sprites, or for the sprite itself, _nearby_enemies, etc..  These are arrays.  You can't modify them directly, but you can modify the objects inside them by using an Each loop.  This will run the events inside the loop, once for each object.  The object itself can be referenced inside the loop using #.

After getting a tile using _tileprops and saving it as a variable, you will be able to see it in the item viewer.  Click on it to see its properties.  You will notice a variable called _sprites.  This is a list of all the sprites in that tile.  (It will not update; _tileprops gives you a copy of the tile data.)

So let's say you want to flip all the objects adjacent to the tile.  For each adjacent tile, first get its tileprops and store it as {tile}.  Then do something like this:

Code: [Select]
Each tile._sprites
   If #._name = "fliptile1" <-Check the sprite's name to determine if it is the right kind of object
      #: transform into fliptile2
   Else if #._name = "fliptile2"
      #: transform into fliptile1
   End
End

You can reduce redundancy by putting the above into its own function and calling that function once for each relevant tile.

Anyway, I fixed up some bugs relating to storing items and also fixed the Default Death Location function.  Also added an "unload room" function that allows you to reset a persistent room.  Going to the world editor automatically resets all rooms.  Oh, and background music now keeps playing until it is overridden by a different background music, so you only have to set it for the first room in an area.

Kamani

  • Bay Watcher
  • Hello hello hello!
    • View Profile
Re: BoundWorlds Open Alpha - Explore the Multiverse and build a world!
« Reply #701 on: January 05, 2018, 02:04:28 pm »

Ohh. Okay. Thanks. I want at least one puzzle in my dungeon.

I think I am going to do two 32x32 floors, then the miniboss, then two more 32x32 floors, then the boss.

Unload room should help with the dungeon. But I probably still won’t have any music, since I play everything muted.
Logged
Boundworlds: A Multiverse Creation and Exploration Action RPG
Good if you can't focus on a single project long enough to make a full game. Or for making an entire large game, if you feel like it.

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: BoundWorlds Open Alpha - Explore the Multiverse and build a world!
« Reply #702 on: January 06, 2018, 02:12:41 pm »

Certainly sounds cool.

I do suggest adding music anyway, at least for the benefit of other players.  I can make suggestions if you can't hear them for whatever reason.

Remember, if you change the ID of a room, it breaks all gates leading to that room.

Also, for the dungeon intro, make sure to account for players backtracking.  (I usually run a check on the cutscene handling object's _create function to compare its _y value to the player's, and destroys itself if the player's _y value is less than its own.)

Kamani

  • Bay Watcher
  • Hello hello hello!
    • View Profile
Re: BoundWorlds Open Alpha - Explore the Multiverse and build a world!
« Reply #703 on: January 06, 2018, 08:58:25 pm »

Thanks.

Okay. I generally play games muted, and since the music I generally listen to is modern chiptunes, synthwave, and classical, so I could use some advice for this.

Oops. Right. Thanks.

Oh, that should work better than just setting it to persist. Thanks.
Logged
Boundworlds: A Multiverse Creation and Exploration Action RPG
Good if you can't focus on a single project long enough to make a full game. Or for making an entire large game, if you feel like it.

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: BoundWorlds Open Alpha - Explore the Multiverse and build a world!
« Reply #704 on: January 09, 2018, 03:26:55 pm »

The first chapter of the World of Protea is up.  A village, a dungeon, some items, a minor bug-catching subquest (sort of), and a boss battle.  Should be a solid 20-40 minutes of gameplay.  A fairly nice demonstration of the sort of things that are possible to build.  Completing the dungeon gets you an item that will save your progress for the next chapter.

Next up, more features.  Next on the checklist is either status effects or item partitions.  Probably going to go for item partitions first.
Pages: 1 ... 45 46 [47] 48 49 ... 90