Stencyl 3.4.0 is now out. Get it now!

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 ... 95
Journals / Re: HOUSE KEEPER Turn based RPG (WIP)
« on: Yesterday at 02:49:00 pm »
I like the idea of a black-and-white game. Would be neat to see the concept explored further.

Journals / Re: 3D Library Adventure
« on: Yesterday at 02:45:50 pm »
Nice screenshots so far! Please do keep us posted; this looks really interesting. I'd be particularly interested in learning how you integrated the Away3D library into Stencyl.

Extensions / Re: Cross-Promotion/Direct Deal Platform w/ Extension
« on: August 15, 2017, 06:38:49 pm »
Can't you run your own ads using in-house ads under admob? It's been a while.

Either way, I agree with LIBERADO. $29/month sounds steep.

Journals / Re: Castle Woodwarf
« on: August 15, 2017, 04:11:53 pm »
I'd be interested in a mobile version :)

I don't know if there's a foolproof way to sitelock anything. My last game got stolen, too (admittedly, I didn't even both sitelocking it, though). If you're planning a mobile game, maybe embed an advertisement for it in the Flash game?

Ask a Question / Re: Image to large
« on: August 15, 2017, 04:02:38 pm »
Does disabling import at 4x help? 2x?

Journals / Re: Merrak's Isometric Adventures -- Back to the Goat..
« on: August 14, 2017, 08:02:14 pm »
DrawStack Drawback. It's been a while since I looked at my old code. It's a mess  ::) That's to be expected, I suppose. Feature creep, old ideas that didn't pan out (but I wasn't ready to delete), and inefficient methods all contribute to "the blob". I also think the principle, in general, wasn't ideal.

As mentioned earlier, "DrawStack" is the scene renderer--basically an extension of the default Stencyl scene renderer with extra code meant to manage draw order. Up to now, the approach I've taken is to sort the actors and draw them in order from furthest back to  closest (to the viewer). This was accomplished by manually drawing the actor's image. Bitmap operations tend to be slow, so DrawStack was the single biggest consumer of CPU time.

Stencyl seems to be much faster at rendering actors than drawing images manually, so I want to take advantage of that. In addition, I also want to take advantage of new features coming in to Stencyl 3.5.0. Instead of looping through all the actors and drawing them manually, I can sort the actors using z-order. At least, that's the plan. I couldn't do this before because I had so many actors (thousands). With the wall renderer, I can represent each wall using only a single image, so managing a sorted list is feasible.

Wall Renderer Woes. I took another look at the wall renderer and noticed it was slow--about 12 FPS on desktop build. My goal is 240 FPS (chosen because such an efficient renderer would have room to grow).

It's important to note that 12 FPS is what is achieved when all the walls are redrawn every frame. This is a worst case scenario, which I call the "flickering lights test". If I had a torch in the room, for instance, then the light level would change (slightly) every frame, necessitating redrawing the entire room every frame. Practically, I could achieve a torch effect using shaders very easily, so the "flickering lights test" is more of a benchmark and goal than a practical concern.

Moving actors would only require redrawing the walls for which their shadows should be added or removed. I could live without this feature, but I would really like it. It is possible that a lot of moving actors in a room could trigger an entire room re-draw. So... how to fix the issue?

I did some research into optimizing Haxe code and found quite a few useful tricks. First and foremost, take advantage of inline functions when appropriate. Math macros are a good candidate. Converting my vector calculation routines to inline functions had the single biggest effect--doubling the speed.

Second--hxPixels (mentioned a few posts ago) gives a nice boost to per-pixel operations. I actually implemented it and it works very well, albeit with one achilles' heel: converting back to bitmap. The culprit here is garbage collection. I'm still using the legacy OpenFL, so I'm hoping that upgrading will address this issue. From what I've read online, I'm not obtaining nearly the boost I should be--but I'm using that older version of OpenFL.

Third--Pre-computing values is a way to trade some memory for some CPU time. In time-sensitive functions (e.g. per-pixel operations on a bitmap), pre-compute any values you can and store them in memory.

Fourth and finally--this is specific to my own application, but is nice to know if you want to do something similar. One time-sensitive function is the one that checks if a pixel lies in a shadow. Each shadow is a polygon, so the way I tested this is to test if the pixel lies to the right of each edge of the polygon. (Note that the polygon is drawn clockwise). If this is indeed the case, then the pixel lies in the shadow.

I realized that it's redundant to perform this check against edges of a shadow that lie completely outside the wall. This is because of two things: First, if I'm even checking for a shadow at all, then I can assume at least one pixel on the wall belongs in a shadow. Second, I only need to care about pixels that are on the wall. If a pixel isn't on the wall, then it doesn't matter if it's in a shadow or not, because I won't be drawing it.

So if I keep only the edges that intersect the wall somewhere, then it is sufficient to perform the right-side test against only the surviving edges. If a shadow has no edges at all, then I can assume the entire wall is covered by the shadow.

All in all I managed to achieve 84 FPS.

So I'm still off my goal by a factor of three--but it was off by a factor of 20. I can live with 84 for now, and wait to see what improvements the new OpenFL brings. I do have one more trick up my sleeve--multi-threading--for which I've had some promising early results. If all else fails, nothing says I have to render the walls at the same rate as the rest of the scene. I just need to think of the new DrawStack as a manager of separate drawing routines, rather than one large drawing routine.

Ask a Question / Re: canceling an updating event ?
« on: August 14, 2017, 06:32:40 pm »
I think I misread the original post :P

Windows / Mac / Flash / HTML5 / Re: First game: Jessie's Gift
« on: August 14, 2017, 07:11:05 am »
I played it and won. Yay :)

I thought it was an impressive "Hello, World" game. I like all the little animation touches, like the light switch and computer monitor. Navigating the dialog system works nicely as well.

For what they're worth, a few of my suggestions:
I think the search mechanic needs a lot of tweaking. The core functionality is fine and works well, but little things felt off. 

I was lost at the beginning because (space) wasn't doing anything. I had to be standing at a precise location to get the door to trigger. The door space could be wider, too. It'd be easier to walk through it.

Once I got in the room, (x) didn't work at all after I found the key. Holding space while a dialog is up will show the (x) locations.

It'd be neat to see a battle system put in. What evil dust bunny lurks in Jessie's room? >:(

Ask a Question / Re: canceling an updating event ?
« on: August 14, 2017, 06:49:40 am »
...Could I replace it with a do erey 0.01 second loop  and canceling it in a condition ??

FYI: An 'always' event fires on every engine step, which is .01 second.

Ask a Question / Re: Stencyl memory raising batch files not working.
« on: August 10, 2017, 10:14:34 am »
I think there's a max setting for the xmx parameter (memory usage setting). I do remember on my old computer I could not set it past 8 GB even though I had 12 GB RAM installed. I don't know what determined that cap, and I wasn't able to find much documentation on the issue. Eventually I got a new computer with more RAM and was able to set it higher (set to 24GB out of 128GB and working fine). Maybe it's an OS issue? I went from Ubuntu 13.04 to 16.04. I don't know what to expect with Windows 7 vs 8 vs 10.

You could try decreasing the xmx parameter a bit at a time until you get a value that works.


Chit-Chat / Re: Hey im new
« on: August 09, 2017, 03:30:52 pm »
Welcome aboard!

Ask a Question / Re: Stencyl memory raising batch files not working.
« on: August 09, 2017, 06:51:23 am »
Just to be clear, what's not working? Is Stencyl launching with a lower memory limit, or is the script refusing to run entirely?

Journals / Re: Merrak's Isometric Adventures -- Back to the Goat..
« on: August 07, 2017, 11:28:17 pm »
Moving On... I took a week off and went to visit family out of state. Now I'm back and realized that none of my ideas for LOWREZJAM will help me accomplish my goals. Game jams are great for getting creative juices flowing and testing new ideas, but I'm not in a rut and I have a clear objective. So as much as I'd hate to drop out before really getting started, I need to focus on priorities.

On the plus side, the wall renderer is complete.  8) This is the final test render.

The goats now light up correctly, thus solving the last problem in the wall renderer. So, a celebratory checking-off of the to-do list:

The next step is to rebuild the "DrawStack" code, which is the game's scene renderer. The so-called "moving lights" problem lies here. Older versions of DrawStack were responsible for arranging images so that their z-order was correct. The updated version won't be any different in that regard, but it will need to be able to handle both bitmaps (for walls and floors) and actors (moving actors).

While the wall renderer works, I think I can squeeze more efficiency out of it. One idea I'm exploring is using multi-core processing to handle tasks that can be divided. I have a lot to learn here, since at this point I'm not sure what is even doable. The faster I can make shadow projection, though, the more complex rooms I can build.

Ask a Question / Re: Assets show up as black/blank on mobile?
« on: August 07, 2017, 10:06:27 pm »
RAM on your phone is what I meant. Is it showing up with just the one frame? If so then you might be able to get all 35 frames by using 1x instead of 4x. I don't know what typical RAM usage should be--but if that's the issue then just because it works on your phone doesn't mean it'll work for all. Could you have a separate actor for each letter and move the actors instead of using animations?

Ask a Question / Re: Assets show up as black/blank on mobile?
« on: August 07, 2017, 07:21:58 pm »
My thought was that the mobile device was running out of memory. You ought to be able to confirm that's the problem by temporarily replacing it with an actor of the same size, but with only 1 frame and @1x scale. 35 frames and 1500 x 350 seems high.

Pages: 1 2 3 ... 95