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 - merrak

Pages: 1 2 3 ... 121
Windows / Mac / Flash / HTML5 / Re: Oregon Trail: Hot Pursuit
« on: Yesterday at 11:32:03 pm »
You can always make your engine public and write some documentation for it :D

I wouldn't know where to begin documenting all of it :D A general purpose game engine is a long-term goal, but as it is now, "engine" is probably a misnomer. A lot of what makes my game unique is built right into the general purpose rendering code.

But--I was making blocks for a while. I have about 100 of them--and could easily add 100 more. I also do have some documentation started, so that was certainly the original intent. At the moment I think the algorithms are more useful than the actual code, even though it'd take a lot of work to implement them from scratch.

On a similar note, I thought writing some kind of "essential math and algorithms for game developers" book could be an interesting pursuit. There's a lot already out there, but most of these kinds of books are really best used in a classroom. A book for self-teaching is harder to write... especially math. But basing a title, and examples, off of Stencyl might give it a shot at working, since it's so easy to program examples.

There are some blocks in the Scene -> Actors palette, but if none of those will help then you might end up having to create a behavior like NickamonPoppytail suggested. A simple design would be to have a custom event, like "changeAnimationOnEnd".

When the scene ends, loop through every actor and trigger that event for all behaviors. It will execute for only the actors that have that behavior, which gives you control over which actors animation should change and which shouldn't.

Windows / Mac / Flash / HTML5 / Re: Oregon Trail: Hot Pursuit
« on: Yesterday at 09:31:14 pm »
Thanks! Unfortunately, I seem to now have a case of the "now what?"s. I completed one of my major development goals (the layer system for Vallas) and also completed an entire game for LD. So where to now...

Journals / Re: Ludum Dare 41: Incompatible Genretor
« on: Yesterday at 09:28:59 pm »
That's pretty impressive to see this created in Stencyl in such a short time frame.

Windows / Mac / Flash / HTML5 / Oregon Trail: Hot Pursuit
« on: April 22, 2018, 07:39:21 pm »
O r e g o n   T r a i l  :  H o t   P u r s u i t

Oregon Trail: Hot Pursuit takes you back to a time when pioneers strapped rockets to their oxen and jet across the open frontier. Youngsters will learn all about “American history” in this new take on the under-appreciated edutainment/racing genres! Seven glorious colors and Apple ][ 280 x 200 resolution. Oregon Trail: Hot Pursuit is a learning experience your children will be sure to never forget.

This is my entry for Ludum Dare 41 (Compo). Of all my entries, this was probably the most fun to make... mainly for all of the opportunities to just be silly. I tried to stick close to the version I remember best--the Apple ][ version. So I used the Apple color palette and resolution. I didn't go as far as to create the color artifacts--so it's not quite right. But it's close enough for me.

Ask a Question / Re: Sound Wont Play?
« on: April 20, 2018, 05:26:24 pm »
Have you verified the code block in the last snippet is ever triggered? (e.g. put a print block in the same 'if snapped = true' wrapper and see if it shows up in the log viewer when you run the game)

Ask a Question / Re: The Laser Problem
« on: April 20, 2018, 05:21:23 pm »
If you have the ... position where your raycast hits a tile...

Just to add a quick comment on this: Unless something changed with the raycast extension, I don't recall that being a simple thing to calculate. You don't want to use the (x,y) location returned by the raycast, since that won't give you the position of the tile. It'll give you the position of the merged block of tiles.

Instead, you want to loop through the list of collided actors/terrain and find the one with the lowest "fraction" parameter. This will be the first object hit. To compute the (x,y) location of the hit, use

x = x1 + t * ( x2 - x1 )          y = y1 + t * ( y2 - y1 )

where t is the fraction, (x1,y1) is the location of the gun, and (x2,y2) is the other coordinate you pass to raycast. Once you have (x,y), then draw a line from (x1,y1) to (x,y)

Sorting Stumper--Update. I finally got the "Water Room" to render correctly. Here it is with the proper rendering order: Floor -> Marika -> Wall

There are about seven layers in this sector. Moving the actor to the correct subsector ("Occupiable Volumes") was already implemented as part of the collision detection system. So that part came together easily. I just had to get the walls and OVs into the correct layers, which proved to be a bit more challenging than I originally thought. (This is usually the case...)

This is only the first correct room, so I'm not convinced yet that I won't find a few more bugs... but this is a good sign. I can move on to the next thing.

The Water Room is a pretty complicated room. It's not one of the most complicated, but it is far from the simpler test cases I've been using. It has 43 visible walls and 4 OV's. These 47 structures are organized in a graph which is the dependency graph. I figured out Mathematica has a neat feature where it will construct a graph from its adjacency matrix. Being able to look at the graph made it much easier to debug everything.

This is the graph. It's how Vallas Engine (well, the renderer and collision detection parts) sees the room.

The nodes labelled 44 - 47 represent the OV's. The rest represent walls. It's a directed graph where the direction indicates which structure is to be rendered in front of the other. The depth of a node will be the layer the structure should be rendered on.

So if you're writing a walls-based isometric renderer (as opposed to the usual tile-based), here is a general algorithm that will handle rendering order.

Code: [Select]
1. Create a graph. Add one node for each quadrilateral (representing a wall) or hexagon (representing an OV).

2. For each node A and for each node B, determine if their polygons overlap
    2A. If the polygons overlap, determine whether the corresponding 3D structure of A is in front of B, or behind, or neither.
    2B. If A is in front of B, then connect node A to node B.
    2C. If B is in front of A, then connect node B to node A.

3. Write the topological sorting of this graph. I used Kahn's algorithm for this. If the graph is cyclic, return "Fail" (This is what I call the "Escher Error", since the endless staircase will trigger this problem)

4. Compute the depth of each node. I used (ref 1) as a guide, but not the code presented. (ref 2) also is a good reference... a bit better if you haven't seen much graph theory and want a deeper explanation of what's going on.

5. Compute the depth of the deepest node. Call it D

6. Create D number of layers.

7. Draw each wall on the layer N, where N is the depth of its corresponding node.

8. Draw each sprite occupying an OV on the layer N.

Note that 2A, 2B, and 2C are not trivial problems. They are problems I've discussed elsewhere in the thread, though. I spent more time debugging the code handling these three steps than any other part of the process.

Now I have a solution I'm happy with. It's one graph that handles everything rendering related. This solution feels more "graceful" than the previous--the two phase process that felt clunky.

This was one of the final "big problems" in the core engine that I knew I'd have to solve, so it's good to get this one out of the way.

While I'm still working on the map editor and a few other design tools, I've slowly started moving onto the game itself. I worked out more details on a storyline that I think will do well for the episodic format I'm planning on. I've made some further adjustments to the overall map, features list, and stats tables. No release date, but I expect to be done before the heat death of the universe.



Ask a Question / Re: Error That Stencyl Said To post
« on: April 17, 2018, 10:32:55 pm »
Did you forget to attach the file?

Ask a Question / Re: How to open an external file from the game.
« on: April 17, 2018, 10:29:43 pm »
There's a data utils extension that makes it easy to load external files stored in your game's extras folder. I'm not aware of any method to execute compiled code, though. Seems like that'd be a major security concern, but then again Flash didn't get to where it is today for having a stellar security reputation.

Ask a Question / Re: [Help] Tower Defense Follow Path and Waves
« on: April 17, 2018, 10:18:46 pm »
Error 1009 usually refers to trying to use an attribute that has a null value. It'd be easier for me to figure out what's going on if you could post the generated Haxe code (so I can see what line 143 is), but it looks like it's pointing to your activate enemies code. Check if the enemy is null, the path is null, or some element of the path is null.

A simple way to check would be to print the value of these attributes in the code, then watch the log. If anything prints "null", then you've found the culprit.

Ask a Question / Re: Error that doesn't seem to hurt anything
« on: April 17, 2018, 08:49:24 pm »
Maybe the word "Error" is generated by the process (I assume it's a Windows process) that kills other processes? The Linux "killall" is far less foreboding.

Code: [Select]
2018-04-01 16:37:01,055 DEBUG [AWT-EventQueue-0] stencyl.sw.util.Util: Running command: [killall, neko]
2018-04-01 16:37:01,072 DEBUG [Thread-5] stencyl.sw.util.StreamGobbler: [killall] neko: no process found

Ask a Question / Re: Getting pinball flippers to push ball
« on: April 16, 2018, 09:54:10 am »
Joints sounds like a better way to go. The pinball game I made was my second stencyl game ever, and was also on a much older  version. I'd look into doing it differently if I was remaking it.

Ask a Question / Re: Getting pinball flippers to push ball
« on: April 15, 2018, 08:47:48 pm »
I have a pinball game but it's so old I'd have upgrade it from Stencyl 2.2. If I remember right, though, what I did was apply a turning force when the flipper key was pressed, then a force in the opposite direction when the key was released. Just be sure to set the actor origin to the center of the flipper spindle.

Journals / Re: 3D Library Adventure
« on: April 15, 2018, 06:49:23 pm »
Game worked pretty well, although I'm not sure what I'm supposed to be doing :) I got to level 3.

I'd really like to get the point light effect working like you have. I read how to accomplish it by passing a normal map to a shader. I don't think it would require a 3D engine...just knowing how to use or modify the core shader code in the Stencyl engine. There was a tool someone advertised here once... either Sprite d'light or Sprite Lamp, that would take advantage of it.

Pages: 1 2 3 ... 121