GC : Explosive Balls (game play)

posted in A Hobbyist Tale
Published May 16, 2019
Advertisement

Continued adventures with the oneLoneCoder pixelGameEngine (youtube). 

With the current game challenge, time has started to arc over and on the surface, I'm not looking all that great. Under the hood though, things are playing well with each other. I have most all of my render system in place, most update behaviors ready and still have some performance headroom, although I've dipped under standard monitor speed (60hz) sometime last week in test runs. So, two weeks. That's what I get to finish game play, leaving something for cleanup and GC blog/project setup. The original plan is still good and taken from concept to reality. We're here. Got balls, they go boom, they dig a hole and do a pretty splash on their way out the door. Perfect. 

 let_there_be_gameplay.jpg.7da1a981019db38f0a2385961b5ac229.jpg

This last week a terrain smoothing feature was added. After a carve operation and the damage the particle system does as well, leaves pointy/jagged peaks. The smoothing provides landslide behavior and drops stray leftover pixels into the pile. As soon as I realized that, I saw a water implementation peeking it's head out of the sand. So again, here we are. The new yellow object is the puncture pin. Balls and pin against character and his pipes. If balls get the pin down to the pipe, we start flooding for effect game over. That's where my idea went. Did I mention, "not ...all that great" :) 

Working on that mechanic for the next day or two. (I'll be back) (back) What I appreciate in this video is what you get just from std::rand and mod for polarity from the screen vertical position, plus a higher resolution chaos threshold to act or not. But watching std::rand() cycle through is not a bad thing at all in my opinion. Especially for fire and forget. 

The initial stab at it was nice. Tomorrow, another particle system type as the spawner.  As of now, I set an int in my world array to the water ID and update the array like so. Pretty easy and nice addition...now we're making progress.


if (terrain.isStable == true) // not used? always fires at 100 pixel row chunks
	{
		static int tty = terrain.nMapHeight - 1; // search row cursor location (y axis marker)
		for (int n = 0; n < 200; n++) // update count rows of pixels
		{
			tty--; // advance on start for the iteration of the row
			for (int x = 0; x < terrain.nMapWidth; x++)
			{   // scan the single row this frame
				int index = (tty * terrain.nMapWidth) + x; // this location data index
				int indexDown = index + terrain.nMapWidth; // the pixel below
				if (terrain.map[index] != 0)
				{   // we're a pixel. is someone not below me?
					if (terrain.map[indexDown] == 0)
					{	// fall - swap down one pixel
						terrain.map[indexDown] = terrain.map[index];
						terrain.map[index] = 0;
					} // no, is someone down and left?

					if (terrain.map[index] == 1)
					{   // dirt slide
						float rnd = (float)std::rand() / (float)RAND_MAX;
						bool bChaos = rnd > 0.95 ? true : false;   // determine chaos for horizon movement
						if (terrain.map[indexDown - 1] != 1 && bChaos == true)
						{ // settle left - swap (down/left) one pixel
							terrain.map[indexDown - 1] = 1;
							terrain.map[index] = 0;
						} // no, is someone down and right?
						else if (terrain.map[indexDown + 1] != 1 && bChaos == true)
						{ // settle right - swap (down/right) one pixel
							terrain.map[indexDown + 1] = 1;
							terrain.map[index] = 0;
						}
					}
					if (terrain.map[index] == 2)                // 
					{	// water slide                          // just right here (behavior)
						int sign;                               //
						tty % 2 == 0 ? sign = -1 : sign = 1;
						if (terrain.map[index+sign] == 0)
						{ // flow left - swap (left) one pixel
							terrain.map[index+sign] = 2;
							terrain.map[index] = 0;
						} 
					}
				}
			}
			if (tty == 0) // top row tested. reset to bottom to restart scan.
				tty = terrain.nMapHeight - 1;
		}
	}

Reaching another week, with one remaining and some fluff. How we doing? pffttt....oh boy. yes and no. In a way, like that. I'm missing on a new and isolated collision check but the plan is improving. :P I have a loose event and restart working fine. Making progress on the the win aspect being one trigger away. The idea is to get at least one red ball over to the other side of the scrolling play area where a collector of sort awaits.. My level advance logic already works. The power up is in, I just havn't had the want to add in the cheezy AABB test or worse just length proximity trigger. Or imagined what I'm going to be powering up yet. ;) 

This weeks visual and the few issues I'm going after right now. 

 

Picking up speed..is there enough for a safe landing? :) we'll see. 

Second video added showing improved game play and the win case. An ace fell out of my sleeve when testing goal placement for the level progression. An interesting twist, to have to un-bury your target first...from here on out I'm telling the story different. :D But the block to steer and not take damage is a bonus. pffttt...everything from a step back has been bonus with the bogus plan I had :P 

 

 

And lastly now, character involvement. In order to satisfy the scrolling aspect, the camera follows. In order to pretend like he has purpose, a shield has been granted to sink those explosive balls deep. This will close this entry. I now have power ups and an ester egg to go. I plan on tool tips (game play tips) in some small capacity and on the menu screen some clues on how this thing is played. Thanks for hanging out. 

 

3 likes 21 comments

Comments

lawnjelly
Quote

The smoothing provides landslide behavior and drops stray leftover pixels into the pile. As soon as I realized that, I saw a water implementation peeking it's head out of the sand.

Once you get to the level of pixels, I get the impression all kinds of cool stuff becomes available that has been a lot harder since everything became triangles-triangles-triangles with 3d cards. Maybe you can do it with compute shaders I dunno. :) Water would be awesome, but we are getting low on time now!

May 08, 2019 04:16 PM
Choo Wagga Choo Choo

:) the cool part about the water thing is that my structures are set up for it already. It will be close to simply adding a case in one of my switches, hold a variable list of position/velocity pairs and test against the land mass array per frame. Keep the lists small-ish but I'm curious about this thing when I push it really hard. Good fun. I'm developing on a old beat up laptop, source is running well, so I figure all good. Push it some more. This will be my loose game event, so a couple days is fairly invested for the effect. Arrive at a point perhaps, deactivate and carry on. Actually happy with the progress of ideas especially considering the twist in the theme. edit: ended up doing it as a texture concept.

May 08, 2019 04:35 PM
lawnjelly

The water is looking great, and the animated character! :) I'm doing the same thing just adding as many features as possible but still have to 'gamify' it into a series of objectives rather than throw everything at you at once in a sandbox type way.

May 09, 2019 08:48 AM
Rutin

Looking good!

May 10, 2019 04:17 AM
Choo Wagga Choo Choo

'gamify' was the kick in the stern over here, otherwise feature creep would have consumed. 

May 15, 2019 09:32 PM
lawnjelly

Is really coming together now, with the retro sound and music too! :) 

May 16, 2019 05:33 PM
Choo Wagga Choo Choo

one of the coolest tutorial series I've ever played with. Sound generated with math to wiggle the speaker. No input data. Blows me away to also have predictable pitch. I'll be revisiting that after it's over. For me it was a little nerving to a small degree because of the brand new framework I chose. Luckily, I like the core architecture and coding style. Not having to think a single triangle was actually refreshing but I'm yearning to go back to 3D. This was a good run, sad to see only a small turnout. 

oh, and the crappy lightning collisions flub is all good. Starting to feel like a real game now for certain. I think I'm only a few days off from finishing, so the pressure is down. I probably will respect this in the morning taking the role of 5th game to the portfolio. 

May 16, 2019 05:42 PM
Choo Wagga Choo Choo

Added a video showing tonight's fun and excitement. It's like the level is building itself :) 

May 16, 2019 10:57 PM
Rutin

Very impressive stuff! :) 

May 17, 2019 06:12 PM
Choo Wagga Choo Choo

It was (is) cool, this go around I realized a goofy thing with #pragma in c++. Being aware of c# region and accustomed to it, I tried the C++ equivalent to group(and collapse) every new layer I added in. Mainly the content of the crowded update and draw root blocks. If I region-ed you up, you were good, on to the next major thing, distraction free and scrolling in a bloated text module was comfortable again. More so, it was easy to find where you left off in an obvious fashion. I tried to keep an additional rule, to not mix or spread out types of operations. a screen object update would only advance the current step, it's draw would only draw from state and only state change was at the parent update level. My objects don't even know they can be something else :) <sorta'>

May 17, 2019 07:13 PM
Choo Wagga Choo Choo

Attached is the current state of the application. A handful of items are incomplete but it's presentable. Looking forward to a week of cleaning this up.

GDN_SideScroller_goliathForge_TEST.zip

May 18, 2019 07:17 AM
lawnjelly

Works great on my PC 136 fps in the game. Took me a little bit to figure the controls but couldn't work out what I was meant to do, you will need instructions haha! :D 

May 18, 2019 07:26 AM
Choo Wagga Choo Choo

It's a free for all :D Arrows and mouse only. put a red ball in the hole on the other side of the map. character advances camera and can bat the balls. blue power deflectors are movable with center node and outer nodes adjust angle (auto return) down arrow block. Up arrow shouldn't be active, it's part of my ester egg. I only get 40hz over here. :P  

May 18, 2019 07:27 AM
lawnjelly

Ok I've got to level 2, by some miracle! :) It is difficult hehe. I couldn't work out what the spinning green thing did. Also I could use the soldier to move the camera but didn't hit any balls with it so far. Do the balls have a certain amount of bounces until they destroy?

May 18, 2019 07:43 AM
Choo Wagga Choo Choo

down arrow on the character to block. (aim at head (deflection)) green orbs are stand ins (sorry, cool) still don't know what to power up. I think I'll give damage if the 'explosive balls' on good hit and you are not blocking. Ball bounces are random 3 or 4 terrain bounces. (it's supposed to be 3 bounces, but I've counted 4 so there is a  bug in there somewhere :() Deflector or character bounces are dismissed. Keep it up in the air or go get another one :D thanks dude. 

May 18, 2019 07:49 AM
Rutin

I'll give it a try in a few days and post back. :) 

May 19, 2019 11:05 PM
Choo Wagga Choo Choo

No worries.. That will give me a chance to put an update in maybe tomorrow. Sound has been improved by a long ways. I was missing on my sound release time and it made it muddy. But an accidental fix cleared it up. Sounds great now. Maybe not so accidental, but certainly a surprise. Re-arranged the three bar looping music. It's groovy now instead of just noise. Added difficulty by scaling time. It's pretty fast, some collision types ghost through at the faster speeds, so I need to break up the step to ball radius(x2?) perhaps. Been playing it, trying to make it fun. meh, not bad-ish.  Still need to finish up the pipe configuration arrays. It's a play, add/smudge/play routine now with the driving data.

May 20, 2019 12:00 AM
Choo Wagga Choo Choo

Attached is an updated version. Hope to get a bow on it this next week.

GDN_SideScroller_goliathForge_TEST_02.zip

 

May 20, 2019 03:02 AM
lawnjelly

1470145087_Screenshotfrom2019-05-2116-41-01.png.727b003e053909441bbe9bb212a5398e.pngI got to level 3 this time!! I did encounter a bug where the soldier disappeared then he reappeared several pixels above the level of the terrain, but could walk about as usual, just higher than he should be. I wasn't sure how to dig the hole to the cauldron so I can complete the next level, is the idea to get the balls to explode and dig the hole for you? :) 

May 21, 2019 03:43 PM
Choo Wagga Choo Choo

Ah level three, the digging problem. You know, the no weapons thing :D 

Nice one...I hadn't noticed that one yet. Although, I've ripped the transform matrix stuff and went back to straight array blit yesterday.. It wasn't so much this issue (the transform not being the driver) but I wasn't happy with movement.  Now I'm reworking the character controller to be a little more influenced by [ this GDC16 talk ]. Being set up in this fashion, I'm now moving to experiment with the equations. 

May 21, 2019 03:56 PM
Choo Wagga Choo Choo

Tidy up pass. Project Linkage

Great challenge run. Good times. Thank you. 

 

August 02, 2019 06:45 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement
Advertisement