Page 4 of 4

Re: Cubytes / AssaultCube Devlog - REVIVAL

Posted: June 17th, 2017, 1:20 am
by Battlefrog
Cooked up something for the project after Cubytes is finished. GX19 is the working title.

Image

And yes, that's what the game will look like. I'm aiming for a old graphics card showcase look. (But apparently way shittier... :lol: ) Also, not far off from LSD: Dream Emulator. :P

Oh, before I forget, still working on the Level class, and right now I'm implementing albino's suggestion into the codebase.

Re: Cubytes / AssaultCube Devlog - REVIVAL

Posted: June 17th, 2017, 3:46 am
by Battlefrog
Tonight went alright.

As albinopapa suggested, I implimented his advice - slightly.

For some reason, I couldn't get the iterator working (Most likely because I didn't know how it works :lol: ), so I settled for this instead:

Code: Select all

bool foundLevel = false;

	if (foundLevel == false)
	{
		for (int i = 0; i < numStoryLevels + 1; ++i)
		{
			if (storyLevels[i] == level)
			{
				LoadLevelIntoCurrentLevel(storyLevels[i]);
				foundLevel = true;
			}
		}
		for (int i = 0; i < numArcadeLevels + 1; ++i)
		{
			if (arcadeLevels[i] == level)
			{
				LoadLevelIntoCurrentLevel(arcadeLevels[i]);
				foundLevel = true;
			}
		}
	}
Most likely less functional than iterators, but the main thing is that it compiles.

Tomorrow, I'll be finding out how to load custom levels from levels(if refactoring doesn't get in the way...)!

Re: Cubytes / AssaultCube Devlog - REVIVAL

Posted: June 17th, 2017, 4:06 am
by albinopapa
I'd maybe put a break in there. That way when the level is found, it exits the loop. Maybe even combining the loops if the number of story levels and arcade levels are the same.

Sorry about the iterator thing, don't have your code, so couldn't test what I wrote.

Re: Cubytes / AssaultCube Devlog - REVIVAL

Posted: June 17th, 2017, 4:15 pm
by chili
Not sure what that is but it looks cool. :lol:

Re: Cubytes / AssaultCube Devlog - REVIVAL

Posted: June 17th, 2017, 6:06 pm
by Battlefrog
albinopapa wrote: Sorry about the iterator thing, don't have your code, so couldn't test what I wrote.
You're fine albinopapa. Besides, you gave me inspiration!
chili wrote:Not sure what that is but it looks cool. :lol:
New project in the works after Cubytes. It'll be using Unity, and it'll be quite odd. It'll be a exploration game, with extremely odd visuals, as you can see :lol:.

Like Cubytes, the project will work with my limitations (with 3D Modeling) and hopefully bulid around it by using cool shader tricks or something along the lines of that :P.

It'll focus more on the story than Cubytes, that's for sure.

I'll be telling more when Cubytes is more or less starting to get finished.

Re: Cubytes / AssaultCube Devlog - REVIVAL

Posted: June 18th, 2017, 3:38 am
by Battlefrog
Alright, I finished a rough state of level loading.

Next up on the agenda is to figure out FileIO, so I can load information about levels from txt files. It'll make it easier to maintain and create levels.

After that I'll be working on getting the system to work in the game. :)

Hold tight. Alpha 3 will be the the largest gap between updates. Hopefully after Alpha 3 I should get out weekly or bi-weekly updates.

Re: Cubytes / AssaultCube Devlog - REVIVAL

Posted: June 19th, 2017, 1:44 am
by Battlefrog
Encapsulated the shit outta the level code, or at least the things I NEED to encapsulate. :lol:

Tomorrow I'll work through the Intermediate series to FileIO, and see if that solves my problems :P

Here's the code, if any of you are interested.

Code: Select all

#pragma once
#include "Block.h"
#include "Player.h"
#include "Point.h"
#include "Goal.h"

#include <vector>
#include <string>
#include <assert.h>

class Level
{

public:

	// Compares the level titles, not the actual content.
	// It's much nicer, and quite possibly faster.
	bool operator == ( Level &level);

	// Adds the titles and other misc. things to the levels.
	// THIS IS NEEDED. CALL ME, BUT ONLY ONCE!
	// Again is a waste of time.
	bool InitLevels();

	// Finds and loads the level requested into the CurrentLevel.
	void FindAndLoadLevel(Level &level);

	// Unloads the level generically so that a new level can be loaded.
	// A nice blank, clean state, really.
	void UnloadLevel(Level &level);

	int GetGoalX();
	int GetGoalY();

	int GetPlayerStartX();
	int GetPlayerStartY();

	// Vectors for holding the blocks and the points
	std::vector<Block> blocks;
	std::vector<Point> points;

	// Title for the level. Might be shown to the player, 
	// but the primary purpose is to compare levels.
	std::string title;

	// Amount of things in the level. Nice to use for loops.
	int amountOfBlocks;
	int amountOfPoints;

	// A singular goal, as you'd like a goal...
	Goal goal;

private:

	// Scans a .txt file for level infomation and adds it to
	// the various factors of the level
	void CollectAndStoreLevelInfo(Level &level);

	// Actually loads the level. Not needed to be called, this is used internally.
	void LoadLevelIntoCurrentLevel(Level &level);

	// Simple x and y pos of the goal
	int goalX;
	int goalY;

	// Two ints for holding the starting position of the player
	int playerStartX;
	int playerStartY;

};

int numStoryLevels = 6;
int numArcadeLevels = 6;

std::vector<Level> storyLevels;
std::vector<Level> arcadeLevels;

// The container for the currently loaded level. Levels are just
// buckets of infomation, but the CurrentLevel is where everything
// gets rendered, collides with, etc.
Level CurrentLevel;

Re: Cubytes / AssaultCube Devlog - REVIVAL

Posted: June 19th, 2017, 2:36 am
by Battlefrog
I created a Trello board for monitoring my progress on the game.

It won't die, I promise.

https://trello.com/b/TiNYWGFh/cubytes