Jump to content
  • Advertisement

GC : Explosive Balls (game play)

MarkK.

3531 views

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. 

 



21 Comments


Recommended Comments

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!

Share this comment


Link to comment
MarkK.

Posted (edited)

:) 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.

Edited by GoliathForge

Share this comment


Link to comment

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.

Share this comment


Link to comment

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

Share this comment


Link to comment

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

Share this comment


Link to comment
MarkK.

Posted (edited)

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. 

Edited by GoliathForge

Share this comment


Link to comment

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

Share this comment


Link to comment
MarkK.

Posted (edited)

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

Edited by GoliathForge

Share this comment


Link to comment

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 

Share this comment


Link to comment
MarkK.

Posted (edited)

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  

Edited by GoliathForge

Share this comment


Link to comment

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?

Share this comment


Link to comment
MarkK.

Posted (edited)

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. 

Edited by GoliathForge

Share this comment


Link to comment

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

Share this comment


Link to comment
MarkK.

Posted (edited)

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.

Edited by GoliathForge

Share this comment


Link to comment

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? :) 

Share this comment


Link to comment

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. 

Share this comment


Link to comment

Tidy up pass. Project Linkage

Great challenge run. Good times. Thank you. 

 

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Advertisement
  • Blog Entries

  • Similar Content

    • By Marscaleb
      Hello folks, I was hoping I could get some feedback on some character designs I've been working on for a game I'm making.
      This is for a 2D platformer with a cartoony design.  I'm making three playable characters.
      I'm looking for any feedback at all on these designs; let me know what you think.  Be honest; you don't need to sugar-coat anything.
      Also I have a couple different versions I've sketched out and I'd like to see which ones people like the best.
      One of the designs I'm implementing is that when the player has one hit left, part of their attire get blown off.  (Like in Ghosts n' goblins, when you lose your armor.)  The design on the far left is the one that represents this "no armor" state.
      First of all, this is the mage.  I'm pretty satisfied with his design so I never created different variations.  But I'm still interested in feedback about his design if you have anything you want to say.

      Next up is the reaper.  I was originally planning for her armored version to just be a generic cloak, but I've been thinking lately that I should have something more distinct; something more unique.  So I drew some different sketches of some different ideas, and I'd really like to know which of these people like.


      And finally, the ranger.  I just have a couple different variations on her outfit.  With and without a pauldron, and a shoulder cape.


      And for context, here's a sample scene with some slightly older versions of these characters if you want to see what kind of visual environment they are designed for: https://imgur.com/cZ4oR6L
      Let me know what you think!
    • By Cringey Boy
      Looking for a 2D artist to make with me a top-down game with cool features, guns, spells, and powerups. I'm a programmer, and I already made the code for the guns, different spells, powerups and basic mechanics like shooting and moving and stuff like that. I just don't have any assets to use so I'm looking for 1-2 2D artists, can be a pixel artist or anything that you want. Compensation will be 50% for you and 50% for me if we are only 2 and will be different if we are gonna be a trio, you are not working for me (or volunteering) we are a team. The only thing that I control and you not is the money, but you can argue with me and I will probably give you the amount that you think that you deserve. It doesn't have a name yet, we will decide about the name together. You can create guns with no coding because of a system that I created so you will also be able to create content for the game, besides ideas and art. I really need an artist so if you are interested please contact me in discord: #1615Cringey Boy
       
      I will leave a video to see the game and also the build to try and actually play the game that I have right now. I don't have any art so it looks bad (;
      https://drive.google.com/drive/folders/1Na3JKPBYXuUpxtP-lBUO-hIl0xO1ujSj?usp=sharing < this is the build, just download the folder called "Dungeon" and in there press on Dungeon.exe to open the game.
      Controls:
      1. Switch to the main gun
      2. Switch to the secondary gun
      Mouse Left Click. Shoot (you also aim with the mouse)
      R. Reload the gun that you are holding.
      E. Use main spell (currently, fireball which explodes and deals damage. And you also aim that with the mouse)
      Q. Use secondary spell (currently, heal aura which heals you pretty fast. You don't need to aim)
      (In the video there is no restart but in the build, there will be a restart button when you die)
       

      Desktop 2019.10.21 - 20.55.18.02.mp4 Desktop 2019.10.21 - 20.55.18.02.mp4 )
    • By phil67rpg
      well I am working on a simpler game called tic tac toe, my question is how do I get the mouse click to draw an X on the  board. when I click the mouse nothing happens.
      #include <freeglut.h> #include <iostream> using namespace std; void drawBoard() { glPushMatrix(); glColor3f(1.0f, 0.0f, 0.0f); glBegin(GL_LINE_STRIP); glVertex3f(-18.75f, 6.25f, 0.0f); glVertex3f(18.75f, 6.25f, 0.0f); glEnd(); glBegin(GL_LINE_STRIP); glVertex3f(-18.75f, -6.25f, 0.0f); glVertex3f(18.75f, -6.25f, 0.0f); glEnd(); glBegin(GL_LINE_STRIP); glVertex3f(-6.25f, 18.75f, 0.0f); glVertex3f(-6.25f, -18.75f, 0.0f); glEnd(); glBegin(GL_LINE_STRIP); glVertex3f(6.25f, 18.75f, 0.0f); glVertex3f(6.25f, -18.75f, 0.0f); glEnd(); glPopMatrix(); } void drawText() { glColor3f(0.0f, 1.0f, 1.0f); glRasterPos2f(10.0f, 10.0f); glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, 'X'); } void renderScene() { glClear(GL_COLOR_BUFFER_BIT); drawBoard(); glutSwapBuffers(); } void ChangeSize(GLsizei w, GLsizei h) { GLfloat aspectRatio; if (h == 0) h = 1; glViewport(0, 0, w, h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); aspectRatio = (GLfloat)w / (GLfloat)h; if (w <= h) glOrtho(-100.0, 100.0, -100.0 / aspectRatio, 100.0 / aspectRatio, 1.0, -1.0); else glOrtho(-100.0*aspectRatio, 100.0*aspectRatio, -100.0, 100.0, 1.0, -1.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); } void mouseClicks(int button, int state, int x, int y) { if (button == GLUT_LEFT_BUTTON && state == GLUT_DOWN) { drawText(); } } int main(int argc, char**argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE); glutInitWindowPosition(600, 400); glutInitWindowSize(800, 600); glutCreateWindow("Tic Tac Toe"); glutDisplayFunc(renderScene); glutReshapeFunc(ChangeSize); glutMouseFunc(mouseClicks); glutMainLoop(); }  
    • By RoKabium Games
      On Aura you can find the Track Ray fossilized bones usually split up in 6 parts. This extinct reptile was incredibly colourful and was one of the largest land animals ever to have inhabited this cold planet. It is speculated that the thick feathers and scales were good insulators for the cold and the colour was most likely a display to attract mates.
    • By RoKabium Games
      On Lelantos you can use Portals to quickly go from one side of the map to the other. Each Portal has a number that once discovered will show up on the mini-map to help you keep track of where you are. Just be careful when using these teleportation devices, you never know what waits on the other side of the gate!
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!