Looking for some direction

Started by
6 comments, last by Snaked 10 months ago

For some personal IT background: I built my own machine from parts I ordered myself and installed Ubuntu 22.04 using a boot drive I formatted myself. I understand basic command line, what binary/hexadecimal is, how to work my way through directories, and I've taken some intro to programming on SQL and Python. I had an CompTIA A+ certification and I'm studying my Network+.

In short: At best I can follow technical directions and understand technical terminology

My project goal is to make a game in a small file size that can be launched in a browser from just a thumb drive. I want the game to be top down and have the graphical fidelity/look of old LoZ games, think Minish Cap/Four Swords. I downloaded UnityHub/Unity but I'm not certain if that's a good starting point for the goal I have in mind. I already have an artist who wants to work with me to produce assets; I just need to cover the technical side of things.

Advertisement

As you're newer to development, I'd suggest checking out GameMaker at https://gamemaker.io/.​ It's a bit more simple than Unity, well supported, and designed originally for 2D games (it does support 3D too), and can support your web-based platform goal. While providing a simple interface, it's a very powerful engine under the hood. The team there is also good people.

Admin for GameDev.net.

  1. i suggest you Windows with C++ compiler intended for windows APP not web browser eh?
  2. have clear some concepts and tech like for example how create C++ structures and files manipulation
  3. with files manipulation you create 1) in memory a map readed from that files for the map by tiles
  4. then you make the gamedraw() function 1) draw map tiles 2) draw players 3) implementing some kind of control of animations for some things like gestures/repeated stay movements for characters or players or other kin d of animations…..have in count this animations if you draw the map animations for water movement for example, have to be “controlled” bassed in someclass of timer that basically what do the timer is say to gamedraw() function (by variables) when paint a certainly “step” of a given animation sprite
    I explain this a bit…..imagine we have a variable called animplayer = 0 ---- if for example we have a TIMER based in 1 second (can be milliseconds too) what we do on the OnTimer function is put a variable called animplayer = 1, then cos the function gamedraw() will be executing repeatdly all the time…..on body of this function simply we make:
  5. if(animplayer == 1) { switch(num_animation)
    case 0: DRAW(sprite0); numanimation++; animplayer = 0; break;
    case 1: DRAW(sprite1); num_animation++; animplayer = 0; break;
    case 2: DRAW(sprite2); num_animation = 0; animplayer = 0; break;
    } that make each second the gamedraw() function draws the 3 sprites of a player sprite (or the mentioned water for example) into the loop of draw then independant of the spreed of gamedraw() function we have a sprite animation step by step at 1 second of interval
  6. with some things more we have mounted the Tiled Map and Sprites with some animation in the loop and then just control keyboard or gamepad for move our player in desired direction
  7. you could need a extra structure like map one (array 2D) for keep for example enemies positioning and same for example for have objects positioned in some cells of the grid……you could join this 2 things or more even if you make this array as array bidimensional of a structure with some variables (int for example) for define kind of enemies, and other kind of variables for more other objects placed at that position like for example food ration but remember you have to keep a good control of all for example if you defeat a enemy or take the food item normally you have “erase” from that array structure position for keep updated along the gameplay
  8. the tiles coordinates (cells) are referenced by the arrays dimensions, for example a array of ints called map[1][1] referring to cell x=1, y=1 (cos the tiled map of that games mentioned by you are 2D tilemaps) then the values of that map[][] array can be 1 for grass, 2 for water etc etc
  9. when you drawing map, normally tiles have all same size if its for example 32x32 pixels, you only have multiply 32 x the index of array on both coordinates X and Y on draw coordinates and this way all placed in its right place
  10. you can make drawmap of the scenary map just with 2 FOR loop nested playing with variables on this for's for read X and Y tile, and also for screen positioning (draw on screen…)
  11. the good of all this?? a high speed binary app and a insignificant memory resources comsumption

I mulled this over a little and I've determined that I'll use @khawk's suggestion for prototyping then I'll look at @snaked suggestion for the actual end product. ty

the good of all this?? a high speed binary app and a insignificant memory resources comsumption

This is big. I love shareware and easily ran games. I had a thumbdrive which had the demo for Doom and a cracked version of Minecraft along with flash games that I would share with other kids; I want to add to that directory.

yes, John Carmack appart of be a incredible good programmer also was precursor on the FPS games


i will give you some code tips for the C/C++ game source code

you can build the map structure in something like this:

struct ma {
			char objeto_desc[100]; //Description of the object in map
			int objeto_id;   //Id of object 0-walkable  1-tree  2-Shop  
			                 //3-teleporter 4-floordoor 5-coins
							 //6-wolf enemy - 7-food
			int teleport1X;  //posicionX of the teleporter cell 1 
			int teleport1Y;  //posicionY of the teleporter cell 1
			int teleport2X;  //posicionX of the teleporter cell 2
			int teleport2Y;  //posicionY of the teleporter cell 2
			int pozo_monedas;//can be a well that drop coins for players (timered)
			int reward_pozo; //the number of coins that the well deliver each time
			bool damage;     //the object of this cell produce damage on player
			int quantity_damage; //amount of damage in life bar for example
			bool bonus;      //the object of this cell produce a bonus
			int  variable_bonus; //kind of bonus with a int value for each kind
			int  quantity_bonus; //quantity aplied in bonus (coins for example)
			int kind_reward;  //kind of reward, 1-coins 2-inventory object 3-life                bottle 4-Mana bottle 5-food 6-spell  7-invisibility ring  8-more energy 9-water 10-friend of wolves etc
			bool visible;     // if object is visible (true) or invisible (false)

};

//this for example some objects for compose the map, 1=tree, 0=empty cell 2=shop

int linea1[600] =
{
  1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  1,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  1,0,1,0,1,1,0,0,0,0,1,0,1,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,
  1,0,0,0,0,0,0,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
  1,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  1,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  1,0,1,0,1,1,0,0,0,0,1,0,1,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  1,0,0,0,0,0,0,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
  1,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  1,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  1,0,1,0,1,1,0,0,0,0,1,0,1,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  1,0,0,0,0,0,0,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
  1,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,

};

//Then we build the map array with a X-Y of 100 cells for each axis for example
struct ma mapa_objetos[100][100];
int mapa_enemies[100][100];

For draw map we can do something like this (STEP 1 with a StringGrid component):

Have in count this is code of C++ Builder Rad Studio specific cos it have the windows component StringGrid

with this String grid component tuned, we can have for example a GDI Windows app of someclass of Roguelike ascii map:

void DRAW_MAP(void)
{
  AnsiString icon = ' ';
  int count_line = 0;
  int countX = 0;

   //// Lo primero hacemos un CLEAR limpiando el mapa y borrando la pantalla
	for(int r= 0; r < Form2->StringGrid1->ColCount - 1; ++r)
	 {
	   for(int e=0; e < Form2->StringGrid1->RowCount-1; ++e)
	   {
		 Form2->StringGrid1->Cells[r][e] = ' ';
	   }
	 }
	 
for(int c=0; c<600; ++c)
  {
	  // we draw the "character" of the shop guy
	  if(linea1[c] == 2)
		{
		  icon = 'ß';
			  Form2->StringGrid1->Cells[countX][count_line] = icon;
		 }

	  //we draw the empty spaces
	  if(linea1[c] == 0)
		{
		  icon = ' ';
			  Form2->StringGrid1->Cells[countX][count_line] = icon;
		 }

	  //we draw the trees
	  if(linea1[c] == 1)
	   {
		  icon = '%';
			  Form2->StringGrid1->Cells[countX][count_line] = icon;
	   }


//this if is for the String grid respect the jumplines of the linea1 in different lines
	  if(   c == 39  || c == 79  || c == 119 || c == 159
		 || c == 199 || c == 239 || c == 279 || c == 319 || c == 359
		 || c == 399 || c == 439 || c == 479 || c == 519 || c == 559)
				 {  count_line++; countX = 0; }

	  countX++;
	  if(countX == 39) countX = 0;

  }	 

and could view like this:

but the good thing is later we can “redraw” the ascii representation to 2D Tiles this way

in Form5 (a hidden Form we having the images with sprites)

while(END_ANIMATION == false)
  {
				int kind_of_grass = 0;



	for(int i=0; i < MAP_MAX_HEIGHT; ++i)
		{
		 for(int c=0; c < MAP_MAX_WIDTH; ++c)
		   {
				int x = c * 32;
				int y = i * 32;

				kind_of_grass = rand() % 4;

		   switch(kind_of_grass)
			{
			case 0:

					Form2->FONDO->Canvas->Draw(x, y, Form5->Image2->Picture->Graphic); break;

			case 1:
					Form2->FONDO->Canvas->Draw(x, y, Form5->Image2->Picture->Graphic); break;

			case 2:
					Form2->FONDO->Canvas->Draw(x, y, Form5->Image2->Picture->Graphic); break;

			case 3:
					Form2->FONDO->Canvas->Draw(x, y, Form5->Image2->Picture->Graphic); break;

			}



		   }
		 }


		for(int i=0; i < MAP_MAX_HEIGHT; ++i)
		{
		 for(int c=0; c < MAP_MAX_WIDTH; ++c)
		   {
				int x = c * 32;
				int y = i * 32;

			   if(StringGrid1->Cells[c][i] == '%')
			 {
			   Form2->FONDO->Canvas->Draw(x, y, Form5->tree_image->Picture->Graphic);
			 }

			 if(mapa_enemigos[c][i] == 10)
			  {
			   Form2->FONDO->Canvas->Draw(x, y, Form5->DragonIcon->Picture->Graphic);
			  }
		   }
		}
	Form2->FONDO->Canvas->Draw(PlayerX*32, PlayerY*32, Form5->PLAYER_AVI->Picture->Graphic);
	Form2->FONDO->Canvas->Draw(cloudx, cloudy, Form5->Image1->Picture->Graphic);
	if(NubeMove == true)
	 {
       nubex--;
	   NubeMove = false;
	 }
	if(nubex <= 0) nubex = 500;

			redraws++;
		if(redraws > 30000) redraws=0;
		Form2->Label4->Caption = redraws;
		Application->ProcessMessages();
   }

and it looking like this (with the cloud moving onto the map slowly (i use a Timer for control the moving process with NubeMove variable):

and with just few lines of C/C++ code and couple of components you have near the 2D RPG representation, with a little animation too for cloud but later you can use your imagination for more animation procedures on sprites or scenary….. cool eh?

and just as some example of what you can do in 2 weeks of some coding and design with C++ Builder

My Experimental Game Roguelike Heaven (its Multiplayer roguelike by internet with some features like shoutcast music radios and other things more like Chat by IRC , launch of grupal sounds etc)


The Music Station Menu:

This topic is closed to new replies.

Advertisement