Jump to content

  • Log In with Google      Sign In   
  • Create Account

Servant of the Lord

Member Since 24 Sep 2005
Online Last Active Today, 04:09 PM

#5167464 Speed of fleets

Posted by Servant of the Lord on 17 July 2014 - 01:57 PM

You want your big guns available to pound the defenses...


...which are on the slow ships.

Why? The slowness of the ship doesn't improve the ship. It's a gameplay annoyance.

You want your fast bombers to arrive early

No, I want my bombers to arrive at the same time as all my other ships, so we overwhelm the enemy. I don't want them to arrive early so the enemy can focus all their ships on my early arrivals and take them out before the rest of my ships get there.

The ship speeds are a nuisance - trying to work around the speeds is not me fighting against my opponents, and it's not me fighting against the environment... it's me fighting against the game rules. sad.png 

You want your fast little ships to take your troops from the big slow troop carriers to the beach.

I got a better idea... how 'bout I crash my big fast troop carriers into the beach directly? laugh.png
Why do I want to add extra ships just for couriering troops back and forth between the attacking vessel and the beach?

If they were automatic, and required zero player intervention, then yeah, I can see that as a neat visual effect for added immersion. But otherwise, it sounds like the game would be simulating in detail a boring administrative task.

I'm really not anti-realism. I love realism in games... within reason. But I don't like the realism of tedious tasks to be integrated into games I'm playing, just because that's how other games in the genre do it. There is some place for tedious repetitive tasks in games... but we need to be sure we actually want them when we add them.

Speed then becomes an intrinsic part of your plan of action. The same should be true in a game. It adds another layer of complexity to the game play at a tiny coding cost.

Indeed so. But!
A) I'm not worried about coding cost - I shouldn't add features to a game just because it's easy to do.
B) I'm worried about player annoyance. You don't want your game to die of 1000 paper cuts of minor inconveniences.
C) Complexity is nice... but there's good complexity and bad complexity. Complexity by the layering of more things to manage is 'bad complexity'. "Entities should not be multiplied beyond necessity". Complexity by the dynamic interaction of a small group of simple systems is better, in my opinion. This latter type of 'good complexity' is sometimes also called 'depth' in games.

You may decide to split your fleets into smaller fleets based on speed. Running the risk of your transports getting intercepted and destroyed, but allowing your fast attack boats to get to the enemy quickly and start doing damage.
So if you group your large and small craft into a single uber fleet, you are slow and easily detected, but very powerful and able to defend your self.
Or you could send your big heavy ships of towards a secondary target and send the harder to detect, light, fast ships to the main target. Possibly drawing the defenders away from the primary target.

Everything here is your reactions and decisions as a player to work around the limitation the game artificially constrains you with. Such limitations are good, because yes, they create gameplay by requiring the player to make informed decisions after understanding the rules of the game world - but you have to consider what limitations (and how many) you are adding to the game, and why you are adding them.

Just because the limitations results in player choices doesn't mean it should be added! Almost all limitations will result in player choices - that doesn't mean we should cram them all in a game.

For example, the limitation of fuel I mentioned above, or the limitation of speed under discussion here, the limitation of health, resources, construction speeds, ongoing ship maintenance, available population, attack range, movement limitations (can the ship go within planet atmospheres or must it stay in space? Can it fly through geomagnetic storms?), and so on.

We can pile on more and more interesting and choice-creating limitations on players, layering on complexity just because we can, or we can consider where the real strengths of the game is, the enjoyable fun parts, and figure out how to cut out the unfun parts, and create real depth by adding extra detail around the core parts of the gameplay.
If we just add the same limitations other games have, without thinking them through, we'll just end up creating similar games. What if travel speed wasn't a problem for the player? How will the game change? Will the players focus on defenses - and instead of walls of defenses, will they have to have defenses inside their walls as well, incase their enemies just warp right past their first lines of defense?
What if shipbuilding occurred instantly, instead of waiting three or four turns? Is construction time one of the limitations of your game that you are intentionally adding, or are you doing it 'by default' because other games you've played have done it?
Health and shields on your units? What about making everything 1-hit KO? I'm not suggesting doing that willy-nilly, but I am suggesting thinking about the limitations and resources that you might be accidentally taking for granted in your game's genre. If everything was 1-hit KO, maybe combat revolves around slow moving projectiles (nuclear space, uh, torpedoes? tongue.png), and having your ships try to evade the projectiles, and consciously deciding to sacrifice lesser ships (like a game of Chess) by having them act as a shield and be hit by the projectile. Just a random train of thought by usurping commonplace typical genre and asking, 'Why?' and 'What if?'.

#5167458 MMOs and modern scaling techniques

Posted by Servant of the Lord on 17 July 2014 - 12:58 PM

More in line with the topic, a few years ago I had read from Bigworld about using simulated players to evaluate the scaling behavior of MMOs. With the availability of AWS or Azure, do you know if this kind of testing has been used effectively by studios? Apart from the difficulty of simulating pertinent player behaviors, are there other pitfalls?


I don't know about MMOs, but the indie game SpyParty (a 1 vs 1 game) wrote up a series of articles about using Amazon to loadtest their lobby and game hosting server:

Loadtesting for Open beta, Part 1 & [Part 2], [Part 3], [Part 4]


I found it to be an interesting read.

#5167430 Intialization withn definition?

Posted by Servant of the Lord on 17 July 2014 - 10:23 AM

In C++11, default-initializing your member-variables becomes much clearer:

struct Tile
    TileType      Type  = TILE_EMPTY;
    unsigned int  Color = 0xffffffff;
    unsigned int  Flags = 0;

#5166644 Line numbers for non-terminated string literal?

Posted by Servant of the Lord on 13 July 2014 - 06:35 PM

This is definitely a valid string:

string foo = "
string bar = "

But it's missing a semi-colon to close it. Could you detect string literals that are not followed by the appropriate closing symbol (comma, semicolon, closing-parenthesis, etc...), and flag the line that the string literal first opened on? Unexpected tokens (on line 37) after string literal originating on line 23. Expected ';' after string, got "Hello".

And how does this parse?

string bar2 = "

Shouldn't it warn that 'Hello' hasn't yet been declared, and that there is a missing assignment operator?


Some languages require strings to be on a single line, and use special syntax for multi-line strings (usually two or more quotation marks in a row, with an equal number of quotation marks to close the string). This even allows non-escaped quotation marks within it.



string foo = """
This is
a "multi-line"
string literal"""

This syntax is especially nice for embedding stuff like HTML directly in code.

#5166603 Need advice with game loop

Posted by Servant of the Lord on 13 July 2014 - 12:50 PM

In this instance I'd be inclined to do something like...


bool replay = true;

while( replay )
    get_player_start_locations(); // this function would have a mini game loop while players set their starting locations
    bool running = true;

    while( running )
        running = process_user_events(); // return false when player hits quit button etc.
        if( running == true )

    replay = ask_if_player_wants_another_game(); // again, a mini game loop in here while replay question is displayed


If you expand the functions with the "mini game loops", you get:

while( gameRunning )
    while( gettingPlayerStartPositions )
        //'Place starting positions' logic
        //'Place starting positions' drawing

    while( playingGame )
        //Playing logic
        //Playing drawing

    while( askIfPlayerWantsToPlayAgain)
        //Play Again? logic
        //Play Again? drawing

Then you see it has unnecessary looping.

So it can be simplified like this:

enum GameState { PlaceStartingPositions, PlayerTurn, MainMenu, GameOver,
GameState gameState = MainMenu;

while( gameRunning )
    if( gameState == PlaceStartingPositions )
        //'Place starting positions' logic
        //'Place starting positions' drawing
    else if( gameState == PlayerTurn )
        //Playing logic
        //Playing drawing
    else if( gameState == EnemyTurn )
        //Watching enemy moves
    else if( gameState == GameOver)
        //Play Again? logic
        //Play Again? drawing

Just to be clear, I'm not advocating against functions - just against the use of infinite loops within other infinite loops to control the flow of gameplay.

(By 'infinite loop' I mean loops where the game can't break out of it without player action).

#5166444 How much more work is needed for an S or C corp?

Posted by Servant of the Lord on 12 July 2014 - 01:03 PM

Ideally, my company will be somewhere between PopCap and Sega, but not a massively large AAA studio like EA or Activision who sells their souls for money.


Didn't PopCap sell their souls to EA for money? [linktongue.png

#5166123 Best ways to back-up game (design) documents and arts assets?

Posted by Servant of the Lord on 10 July 2014 - 11:16 PM

GitHub, BitBucket, CodePlex, etc.


Though as far as free options goes, BitBucket kindly informs you if your repository gets over 1GB, but freezes that repository if it hits 2GB (this is the free version of BitBucket).


As far as free online storage goes - since everyone is competing, you can get 10GB (I think?) OneDrive space for free. And they bundle more with Microsoft Office 365 if you happen to be getting that anytime soon. I haven't used OneDrive myself so I don't know how good it is.


I do use DropBox, and after jumping through multiple hoops, I have 7.7 GB for free.


Howsoever! DropBox (and some of the others) particularly warn you that they aren't intended for backup purposes, and they give no promises about data not getting corrupted (to cover their own butts incase of disaster). Other services actually designed for data backups (like Mozy, CrashPlan, and etc...) make more strongly-worded guaranties (Not that a guaranty helps anything if they ever do lose your files).

#5165898 MIT License in PlayStation Vita Game

Posted by Servant of the Lord on 09 July 2014 - 03:59 PM

Option A) Contact the developer of the library and ask them how they'd like credit, or if you can come to some kind of arrangement. Just because a library is licensed under Foobar license 4.7 doesn't mean the developer can't give you a different license. Since it's normally free, I'd think the developer would be happy if you offered him a free copy of your game or $50 beer money in exchange for waving the copyright notice requirement.


Option B) Put it in a "Licenses" section of your in-game main menu. Heck, just appending it to your credits would probably satisfy the requirements (IANAL). Why is it "impossible" to show the license in some buried submenu of the game or in the credits?

(Just make sure it's clear to readers that the entire game isn't covered by that license)

#5165740 Another word for "Spells" or "Blessings"

Posted by Servant of the Lord on 08 July 2014 - 11:48 PM

I like the aforementioned 'miracles', 'interventions', and 'powers', as well as the blessings/curses subdivisions.


Additionally: 'Signs'


Also, 'judgements'. While we usually give that word a negative connotation, in the Bible 'judgement' is used as a word to either negatively or positively give someone what they deserve.

Thematically, it might work well. You could subbranch it to 'Rewards' and 'Punishments'.

#5165321 Organizing a map structure for a top-down tile game

Posted by Servant of the Lord on 07 July 2014 - 12:42 PM

What's left for the tiles? Indices to the image. These could be stored directly, so you end up with a much simpler two dimensional array.

Indices to animations, which contain indices to the image? You'll want to animate your tiles - especially for things like water.

Also, for things like walls, you might want collision data baked into the tile data - maybe (it depends on your game's requirements).


So what you probably end up with is that the map is an array of indices to some kind of tile data struct, which is shared between all "tiles" in maps in the game.

struct TileDetails
    std::vector<ImageSubrect> animationFrames;
    Type type; //For whatever logic your game needs - 'Water', 'Lava', 'Wall', 'Trap', etc...

You do run into some cases where you need data directly at a specific location in a map - teleporting (where does it warp the player to?), and script triggers (which script does it trigger?) - but those kinds cases could be handled separately than the grid-based regular tiles.

#5164983 PhysicsFS help needed to read a directories files

Posted by Servant of the Lord on 05 July 2014 - 08:34 PM

Here's the convenience functions I wrapped around boost.filesystem (sometimes just a renaming of the function wink.png):

FileManagement.cpp | FileManagement.h


boost.filesystem has a boost::filepath and boost::directory class that it'd be better to use, but just incase you're interested, here's my hand-rolled functions for std::string.

PathFormatting.cpp | PathFormatting.h


CharValidators.cpp | CharValidators.h

StringValidators.cpp | StringValidators.h

WildcardMatch.cpp | WildcardMatch.h


Glancing over these files, there are a few areas where they include another header from my codebase, so you'll get some compile errors - but it should be very easy to work around that - they aren't at all badly integrated.

#5164957 PhysicsFS help needed to read a directories files

Posted by Servant of the Lord on 05 July 2014 - 05:29 PM

I'm not sure how to do that in PhysFS, but if it helps at all, boost::filesystem does that fairly easily.
Here's my own convenience functions that I use:

//Elsewhere: typedef std::vector<std::string> StringList;

enum SubFoldersEnum {IncludeSubFolders, ExcludeSubFolders};

	Returns a list of every file in the folder and (if desired) the files in each sub-folder.
	If 'timeThreshold' is specified, only files that have been written to *after* that threshold are returned.
	If 'fileFilterFunc' is specified, this filters out all file names (not the entire path) that don't pass the filter.
	If 'folderFilterFunc' is specified, entire subdirectories are filtered out.
	If 'pathPrefix' is specified, this determines what prefixes the returned paths.
	Suggestions for 'pathPrefix' are: Nothing ("FolderA"), "./" ("./FolderA") for relative paths, or passing in baseFolder for absolute paths.

StringList GetFilesInDirectory(const std::string &baseFolder, SubFoldersEnum subFoldersEnum, const std::string &pathPrefix, std::time_t timeThreshold)
	//Call the original function, but with filters that accept everything.
	return GetFilesInDirectory(baseFolder, IsAnything, IsAnything, subFoldersEnum, pathPrefix, timeThreshold);

StringList GetFilesInDirectory(const std::string &baseFolder, StringValidatorFunc fileFilterFunc, SubFoldersEnum subFoldersEnum, const std::string &pathPrefix, std::time_t timeThreshold)
	//Call the original function, but with a directory filter that accepts everything.
	return GetFilesInDirectory(baseFolder, fileFilterFunc, IsAnything, subFoldersEnum, pathPrefix, timeThreshold);

StringList GetFilesInDirectory(const std::string &baseFolder, StringValidatorFunc fileFilterFunc, StringValidatorFunc folderFilterFunc,
							   SubFoldersEnum subFoldersEnum, const std::string &pathPrefix, std::time_t timeThreshold)
	StringList listOfFiles;
		return listOfFiles;

	boost::filesystem::directory_iterator directoryIterator(baseFolder);
	boost::filesystem::directory_iterator endOfDirectory; //An unitialized iterator is the end iterator.

	//Loop through everything in this directory.
	for(; directoryIterator != endOfDirectory; directoryIterator++)
		//Make sure the item found is a file and not a folder.
			//Get the name of the folder.
			std::string filename = GetFilenameFromPath(directoryIterator->path().generic_string());

			//Check if the filename passes the filter.
				//Check if it was written to after 'timeThreshold'.
				if(timeThreshold == 0 || timeThreshold < boost::filesystem::last_write_time(directoryIterator->path()))
					//Add it to our list.
					listOfFiles.push_back(ConvertWinPathToUnix(pathPrefix + '/' + filename));
		else if(boost::filesystem::is_directory(directoryIterator->path()))
			//Check to make sure we want to crawl subfolders.
			if(subFoldersEnum == IncludeSubFolders)
				//Get the name of the folder.
				std::string directoryName = GetFinalDirectoryFromPath(directoryIterator->path().generic_string());

				//Check if the directory name passes the filter.
					//Get all subfolders and add them to the list.
					listOfFiles += GetFilesInDirectory(baseFolder + "/" + directoryName, fileFilterFunc, folderFilterFunc, IncludeSubFolders, (pathPrefix + '/' + directoryName + '/'), timeThreshold);

	return listOfFiles;

'StringValidatorFunc' is a function pointer (actually, a std::function<bool(const std::string&)>) that can take a string a return either true or false if it accepts the string. I use this for filtering files. Often I pass it my SV_WildcardMatch() functor, to easily filter out something like {"*.jpg", "*.jpeg", "*.png"} - I can also post the code for that, if you desire. It's a slightly modified version of this algorithm.


I have a similar function called GetFoldersInDirectory(). It returns folder names instead of file names.

#5164497 Seeking advice about protecting my ideas/IP

Posted by Servant of the Lord on 02 July 2014 - 11:58 PM

Tom's responses (even the yes/no ones) seem to fit the questions very accurately and do seem to answer your posted questions. That's one of the benefits of conversations, though: You can ask follow-up questions to hone in on the details you are looking for, if the answers he gave didn't resolve all the questions in your mind. 


Do you not understand the answers, do you simply not like the answers (even if they are true), or do you have additional questions?


With legal questions, it's very case-by-case-specific, and is often a question of not whether you should or should not do something, but at what point you should or should not take a specific action. Very very blurry grey lines that makes it so you have to make informed decisions, instead of just following checklists of "do's" and "don'ts".


For example, the amount of time and money you should invest in legal precautions for this project would depend how how valuable this project is, and how serious this project's legal risks are.




I'm very protective of my ideas and IP, as most writers and artists would be. I've put years of my life into it. So, I'm very concerned about releasing games (some of which may be free) and having my ideas/IP stolen. 


I will say this: People steal ideas. It can't be avoided. But they can't steal your creativity. Your ability to produce ideas of higher quality and greater originality than the knockoffs, and your ability to produce more ideas when the previous ideas get stolen.


I'm not saying don't fight back when you notice something being stolen, but I am saying don't get so locked up in fear that one specific idea might get stolen that you forget that you can make more ideas. No single one of your creations should be so valuable to you that you tie up your own worth with the value of that one idea. Even if previous ideas get stolen, each new project you work on should (ideally, but perhaps not always) be better and higher quality than the previous ones. If companies or individuals are going to be following you to steal your works and try to knock off your creations, let them fight in the past (and let your lawyers fight with them, when you are successful enough to afford lawyers) as you march onward with each new bigger and better project.


Knockoff products can't be made overnight - it takes at least half a year and often more to make a game, so that gives your product not only a sizable headstart in the market, they get bad PR for being knockoffs (or else are in a market you're not even currently serving! China, for example), and the fastest they get their knockoff out there, the worst quality it actually is, further positioning your product as the higher-quality alternative.

#5164489 How do you get ideas for new games?

Posted by Servant of the Lord on 02 July 2014 - 11:15 PM

I can't force myself to have ideas - I can only put enough inspiration infront of my mind that ideas are easier to form. I don't mean that creativity is some magical ability only Level 52 Arcane Game Designers have - what I mean is ideas are byproducts of consumption and relaxation. Consume books, movies, music - have conversations about baking or house construction, play with legos. Relax your mind from trying to come up with ideas, by occupying your mind with some menial task you don't have to think consciously about - taking a shower, going for a walk, or something else that doesn't require your mind to be focused on it.
This gives you pieces of ideas. No game, story, movie, pops fully formed into someone's head. It starts off as ideas that are built up, fall apart, reassembled, and sanded back down. You might get some ideas now that you won't use for years but that might suddenly pop into your head when you need them.
I'm sure you probably have tiny pieces of ideas that aren't fully formed. Pick one, and start building off that idea. That core 'seed' idea might not even make it into the final product - but it serves a purpose of being a makeshift platform you can build ideas on - and you build temporary scaffolding on it, then you start to see how it might fit together as a more cohesive whole, and you start to see what parts of the ideas don't actually fit that idea of a cohesive whole you thought of, and you start to have better ideas that do fit the cohesive whole now that you see empty holes that can be filled in.
Ideas don't have to be gameplay gimmicks that many indie games are centered around. They can be characters, or worlds, or items, or whatever. You have pieces of ideas - grab one, and build on it, and as you work, your mess of a temporary structure can continually change as you get ideas and refine the cohesive whole.
Example thought process:



See how, by taking tiny 'seed' ideas - some of which might later be discarded as the idea continues to take shape. It makes sense that the sword can speak, but really, why does it need an eye to see? The eye might get axed. And why a sword? Why not an amulet? Why an amulet?


By taking 'seed' ideas, and just building almost without direction, you then later get your bearing as ideas start flowing more freely, and then can hack the cluster of ideas back into shape, adding, removing, and refining.


Further, when stuck, ask questions. Why a sword? How did a servant boy even get near the object? Surely the king would've locked the object someplace where the object wouldn't tell the information to someone who isn't the king. But now we have such a structure of ideas already in existence, we can build in many directions. We can handwave away the servant boy, make an arbitrary choice of what kind of object the grand advisor was turned into (a parrot? an amulet? a ring the king kept on his finger but that slipped itself off (rather The Hobbit-like) unnoticed?). Now, that the ideas have started to flow, we have alot more to work with.


1) Take seed ideas, build off them, discard the original seeds later if needed. This helps with the flow of ideas.

2) When stuck, ask questions. Who, What, When, Where, and How? This helps with the flow of ideas.

3) Be inspired by existing works. I unintentionally was inspired by Arabian Nights + Aladdin for the world, Jane Austen and Portal 2 for the character interaction, potentially The Hobbit, and who knows how much other things. Choices I make are partially inspired by what I've already consumed, and further, the choices I intentionally avoid making (No, the sword isn't the king trying to get his throne back, too cliched) are also inspired by what I've consumed.


Consume, question, and create. And relax. Don't force it.



#5164371 Speed of fleets

Posted by Servant of the Lord on 02 July 2014 - 12:49 PM


Make entire fleets move at their combined averaged speed.


Alternatively, have the entire fleet move at 0.6 of the difference between the fastest and slowest ship. If the slowest ship moves at 7 speed-units, and the fastest moves at 20 speed units, then the entire fleet together moves at (7 + ((20 - 7) * 0.6)) = 15 speed units.


While I do think it's an elegant way to prevent fleets from moving very slowly, I don't think this would be very realistic (as far as space travel of this sort is currently realistic). The slowest ship can't move faster than its maximum speed, can it? Unless it has an overdrive of some sort, but then I'd apply some damage while this is active to show extra wear and tear.


Realism is enjoyable and definitely worth pursuing, but when it conflicts with enjoyable gameplay, sometimes it has to take a backseat. smile.png

Weaker guns not doing much damage against a more powerful shield players can tolerate, but slow moving ships gets irritating really fast. dry.png


The game can either just be silent about why the slow ships are now moving faster than normal, hoping most players don't notice (or if they do notice, they'll just ignore it and continue playing), or the game can create an in-game explanation for it.


Possible explanation: To move quickly through space, the ships warp space around them. The better they can warp space, the faster they go. The warped space is enough to cover the entire fleet. Therefore, either the entire fleet uses the fastest ship's space-warping drive (i.e. use speed of fastest ship), or perhaps it takes more energy to make warped space cover more ships, so the ships have to combine their space-warping-engines and you use either the average speed or a formula similar to what I had above.


Here's an alternative method of making old ships move faster: Use the same thrusters in every ship, regardless of ship level. But make speed be based on the fuel you provide your ships. As the player researches better fuel, every ship gets that fuel and can move faster.

But how does ships way out in space change their fuel? Answer: Magic. laugh.png


Or you can make 'fuel' part of the gameplay, so ships routinely have to return to your planets to refuel on a regular basis anyway, so they get the upgraded fuel the next time they return to port to gas up. (Note: Fuel doesn't have to be a liquid, it can be bronze, platinum, uranium, and so on, that you convert to pure energy to fly your Skylark spaceship using the 'X' substance you found while... </obscure sci-fi reference>).


[Edit:] Going off of Orymus3's post above mine, you can then have your spaceships have different storage capacities for fuel, to stay out in space longer. An entire fleet's storage gets averaged, because the ships can just transfer their fuel from one ship to another while in space (this should happen automatically without player micro-management). smile.png