Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Servant of the Lord

Member Since 24 Sep 2005
Offline Last Active Today, 10:26 PM

#5129484 The functions on game scoring system

Posted by Servant of the Lord on 06 February 2014 - 10:03 PM

Scores can be competitively (Player A has more score than Player B, so Player A is winning) either as the metric of winning or to give one player some kind of powerup vs another player.

 

But scores can also be used cooperatively, shared between both players. Maybe they together need to collect X amount of points to progress, or maybe (if score is a currency) they have a shared/pooled currency. Or even experience-wise, some games have both players leveling up together by sharing experience equally (which I personally prefer, rather than one player advancing ahead of the other player).




#5129364 caveman rpg - should snow put out your fire?

Posted by Servant of the Lord on 06 February 2014 - 12:26 PM

10 inch of snow = 1 inches of rain.

 

Fixed. wink.png

Also varies depending on the type of snow: dusty and dry snow vs more moist snow.




#5128922 Suggestions for a tile-map editor?

Posted by Servant of the Lord on 04 February 2014 - 10:45 PM

You might also be interested in a less tile-based and more freely-rotated and scaled map editor, like Gleed2D.




#5128818 cleaning up a state

Posted by Servant of the Lord on 04 February 2014 - 02:36 PM

As fastcall22 mentioned, only delete what you new - and if you're a beginner, don't new or delete at all. And if you're a professional, and using modern C++ techniques, you'd use smart pointers 95% of the time anyway so you'd still mostly ignore new and delete.
 

C++ doesn't have a garbage collector, what are you talking about?

This only proves to me that my C++ teacher wasn't that great, he never clarified certain things so I was left to assume.

It's the student's job to ask questions if they don't understand. 
It's the teacher's job to answer questions - that's what they are there for (otherwise, you might as well just read a book).
The teacher can't answer questions that the students don't ask. wink.png
 
Plus, C++ does automatically collect some memory. It doesn't have a "garbage collector", but it still frees memory automatically in certain circumstances. Maybe your teacher was trying to explain how C++ memory was collected, and having heard the phrase "garbage collector" sometime in the past, you might've automatically assumed that the teacher was talking about garbage collection?
 
I'm guessing this is the case, because this is exactly the problem you are having with your code: You think certain memory isn't getting freed that C++ is already freeing for you, and you're trying the manually free memory that has already been freed (or that will automatically be freed later). smile.png
 
As popular as it is to do so, don't assume your teacher is ignorant. Just ask questions if you don't understand. If, after asking questions, something still doesn't make sense, then ask on these forums and we can clarify.
 
Here's how basic C++ variables work: (Don't roll your eyes, this is important to understand!)
int x = 0;
That line of code creates an integer named 'x', that is initialized to '0'. It will automatically be freed when the execution of the code reaches the end of its scope.
 
Example:
void func()
{
     int a = 20;
 
     if(true)
     {
          int b = 70;
          
     } //The variable 'b' gets freed after this point.
    
     int c = 0;
     
} //The variables 'a' and 'c' get freed after this point.
 
If you do this:
void func()
{
     int a = 20;
 
     delete &a; //Programmer  manually frees 'a' (not good).
     
} //Compiler automatically frees 'a'. But since was *already* freed, the program will either
  //crash (if you're lucky) or do unexpected crazy stuff that's really hard to track down and debug.
For every variable in your code, either you're managing its memory, or the compiler is. But not both. Every variable should have an owner: Who owns it? The function? The class? Or are you manually managing it?
 
Now let's look at the lifetime of variables in structs: (classes behave the same way)
struct MyStruct
{
     int x;
};
'x' is owned by 'MyStruct'. When 'MyStruct' has its memory freed, 'x' will also be freed.
 
Observe:
void func()
{
     MyStruct myStruct;
     myStruct.x = 20;
     
} //'myStruct' is freed here. Because 'myStruct' is freed, 'myStruct.x' is also freed at the same time.
 
Now classes also have constructors and destructors, which is important to use. All your 'Load()' code should go in the class's constructor. That's what it's for.
All your 'TidyUp()' code should go in the class's destructor. That's why destructors exist.
//This is a constructor. It's a function called when a class gets created.
MainMenuState::MainMenuState()
{
    
}
 
//This is a destructor. It's a function called when a class gets destroyed.
MainMenuState::~MainMenuState()
{
    
}
Unless you're manually doing something that needs to be manually undone, you don't really need to use a destructor in this MainMenuState class.


#5128647 How do i become a writer?

Posted by Servant of the Lord on 04 February 2014 - 12:11 AM



Sorry to nit-pick, but there's several grammar and spelling mistakes in your post -- when applying for a writing position, those small mistakes would probably result in an instant rejection, so make sure to double proof-read everything when asking around for work cool.png

 

Just to concur with Hodgman, this is an important issue. The mistakes in your post noticeably jump out. Normally I tune those flaws out (it's the internet after all!), but when someone is saying they have skill as a writer, but their everyday writing doesn't vouch for them...

 

To put it by way of analogy, when I hang around artists, even their five-minute doodles have quality to them. They throw away art I'd hang on a wall (despite my supplications and entreaties dry.png).

If you're a writer, even your five-minute posts should be well above the average level of quality (or lack thereof) of the internet.

 

You shouldn't be a grammar-nazi nitpicking others' posts (unless, like in this thread, they come asking for advice wink.png), but you should nit-pick your own posts. If you don't know how something is spelled, look it up instantly. Don't misspell it and plan to look it up later, because each misspelling will lock in that misspelling further in your mind.

Same with grammar, capitalization, etc...

 

[Edit:] Ah, well, there's some leeway granted for when posting from certain devices. Just don't make any job-offers like that! laugh.png




#5128518 Best tile size for 800x600 game

Posted by Servant of the Lord on 03 February 2014 - 02:12 PM

I would suggest a slightly larger resolution than 800x600.

 

Also, I suggest picking the tile size based off of the nature of the game. I use 48x48 for my RPG project, which allows me to put in slightly more detail into every tile than 32x32. On the other hand, larger tile sizes usually means the camera is "closer" to the player (but it doesn't have to mean that). Which, personally, I like.

 

You could make your tile sizes any size you want. They can be 20x40, or 57x31, if you so desired.




#5127909 [ASK] Step by Step become Game Engineer

Posted by Servant of the Lord on 01 February 2014 - 02:30 AM

-what is the very first thing I have to learn?

Well, you have to learn a programming language. Which language you start doesn't matter all that much, as long as you pick one of the more common ones, and as long as you stick with it (and don't jump from language to language while still a beginner).

Consider python. Or Java.
 

-what software i might to use?

You'd use the compiler for the language you chose, that turns your code into a executable that can be clicked on and ran.

You'd also use whatever IDE is good for your language.
An IDE is something similar to Microsoft Word, but for writing computer code into instead of English. (Unlike Microsoft Word, most IDEs are free tongue.png).

When you "download a programming language", usually you are actually downloading the IDE (sometimes) and the compiler.

You could even use Notepad as an "IDE" for writing code, but real IDEs provide other benefits that make programming easier, like coloring different parts of code text in different colors to make it easier to see patterns and meaning.
 

-If I wanna make a game, what plan that i should make before start writing the engine?

You should plan on not writing an engine at all. smile.png 

An 'engine' is a term that people throw around alot but don't really have a well-defined meaning.
For 2D games, most 2D games don't have an "engine". For 3D games, most 3D "engines" are really complex and require skill to design well.
If you were making a 3D game you'd use an engine someone else has already made, not write your own.

As a beginner, you should start by making 2D games. Actually, as a beginner, you should start by writing text-based games. Then 2D games. Neither require "engines". You'd focus on making a game, not focus on making an engine.

Don't even worry about "engines". Just pretend you never heard the term for the next year or two. wink.png




#5127668 Population growth in space colony game

Posted by Servant of the Lord on 31 January 2014 - 01:02 AM

I suppose it'd depend on where you want the gameplay to come from.

If colonies get overcrowded, is there enough food being produced to feed everyone? Less food, do people get more unhealthy? More unhealthy, and cramped in close quarters with overpopulation, does disease and plagues spread?
Are there riots because of the lack of food?
Vandalism and vagrancy (even when there is food) because of close quarters?
Do you (the player) implement a one-child policy like China? How does do the people react to that?

 

Do you already simulate population death (apart from the colony getting destroyed)? That's probably a must (I'm intuitively guessing), if you're to explore this properly.

There's plenty of gameplay possibility here, but there's plenty of gameplay possibilities in alot of areas and you can't explore them all. There's too many fun directions to explore when designing a space sim. laugh.png

 

I'd take a note from Will Wright (designer of Sim City among others), and try to strike a balance between detailed simulation and abstract simulation. Detailed enough to be interesting, but abstract enough to be simple for the player to comprehend and manipulate.

You don't want the player to feel his attention is divided between too many areas at once - while trying to manage the population of one colony, aliens attacked another one, and a third is being sucked into the sun - that wouldn't be fun (cool, but not fun, since I'd have to be doing three things simultaneously).




#5127396 typedef, structs, and arrays

Posted by Servant of the Lord on 30 January 2014 - 01:24 AM

You don't want a typedef (an alias of a type), but a constant (an "alias", so to speak, of a value).

namespace clr
{
     const Colour red = colours[0];
     const Colour green = colours[1];
}

 
Though, I don't recall whether 'colours[1]' is garunteed to be initialized before 'green' is (might be undefined behavior), so it'd probably be better (and clearer in the code) to do it the other way around:

namespace clr
{
     const Colour red = {1.f, 0.f, 0.f, 1.f};
     const Colour green = {0.f, 1.f, 0.f, 1.f};
 
     //pre defined colours 
     Colour colours[6] = {red,
                          green,
                          etc...};
}



#5125673 How to make a competitive stealth game interesting for both players?

Posted by Servant of the Lord on 22 January 2014 - 11:08 AM

One thing you can give the second player to do, is have him be positioning and re-arranging the guards, rotating cameras, and things like that for a better security layout, while Player One is infiltrating.

 

The security could already be set up with a basic layout, but Player Two would want to re-arrange everything, and that takes time (for Guard A to reposition himself in Room B), and it takes time for Player Two to manually go through each guard (Player Two "making the rounds" at a high level of abstraction) to make sure they are in ideal positions.




#5124085 Ugh! Your shorthand is too short!

Posted by Servant of the Lord on 16 January 2014 - 02:05 AM

so I looked around and found this implementation, full of one letter variable names

 

Yea, that's something that annoyed me when learning easing functions - everyone assumed I knew what (float t, float b, float c, float d) stood for.

 

The 't' stands for 'time'? No, 'c' stands for 'chrono' - which means time. No, no, 'd' is time and stands for 'delta'... What's 'b'? Baklava? dry.png




#5123400 What do you want in your development tools?

Posted by Servant of the Lord on 13 January 2014 - 04:33 PM

Coming from a C++ background, separate class interface from implementation. Automatically pre-declare what it makes sense to predeclare, and include what it makes sense to include.

Bread-crumb style Project->Module/Namespace->Class->Function navigation in the IDE.

IDE built-in documentation. The rich-text documentation description for a function is visible and editable right above where the function itself is is visible and editable. Includes embedding images (for graphs and graphical demonstrations of GUI appearances or blend modes), tables, things like that.

7i7i.png4ruw.png

As soon as I stop typing, I want the program to invisibly and automatically start recompiling the single file-fragment that changed. If it fails, fail silently (and put a little red "not compilable" icon next to that file-fragment's link). I might go and change other pieces of code... but if project compiling was spread out while still working on code, and while moving the mouse pointer about the gui, and when every piece of code compiles fine, automatically and invisibly begin the final linking step, by the time I finally click "Run", the compile should already be a good step along, improving productivity.

Obviously this isn't as big a deal for large projects that take hours to compile, but it helps smaller projects that only have (incremental) compile times less than 10 minutes.




#5123381 Turn based, Grid based movement - score cost in, or out of cells?

Posted by Servant of the Lord on 13 January 2014 - 03:39 PM

Test when moving into a cell... but test for, "Do you have any points left?", not "Do you have enough points?".

This allows the unit to move into a cell even when the unit doesn't have enough points, as long as the unit has some points so they can always move at least one tile, even through the worst of terrain (Obviously excluding terrain which that unit is never allowed to walk on, like water if a non-water unit).

In a situation where the mountains cost 5 movement points, and the unit only gets 4 points a turn, he should still be allowed to move one tile.
If the unit has 6 movement points, he should move the first tile (subtract 5 for stepping on mountains), be left with 1 point, and since he has "some" points, even if not enough, he should get to move to the second tile (subtract 5 points, leaving a remaining -4, snapped back to 0).

For travelling over mountainous terrain that costs 5, units with 1,2,3,4, or 5 movement points can only travel 1 tile. Units with 6,7,8,9, or 10 can travel 2 tiles, units with 11-15 can travel 3 tiles, and so on.
 

//Pseudocode:
if(unit.movement > 0 && unit.canWalkOn(tile.terrainType))
{
    unit.moveTo(tile)
    
    //Because different units have different costs for terrain, and because some units might be individually and 
    //temporarily (or permanently) buffed with lower costs for specific types, so store per-unit instance.
    //Obviously varies depending on your game design.
    unit.movement -= unit.costOfMovingToTerrain[tile.terrainType]
    
    //Bind to zero, if we went negative.
    if(unit.movement < 0) unit.movement = 0;
}



#5123167 Zynga Pulls Plug on YoVille - Million$ in YoCash evaporate!

Posted by Servant of the Lord on 12 January 2014 - 06:20 PM

Just so nobody from outside the forum gets the wrong impression: We're not Zynga, we don't represent Zynga, we are not affiliated with Zynga, and we have no influence over Zynga's decisions to close or keep open YoVille.
 
Yes, morally, Zynga has done wrong to mislead the community. It is perfectly possible that Zynga's upper management was lying to and misleading the YoVille developers before maybe firing them. It's not unheard of that developers think the game is going to continue (and so reassure the community) because they themselves have been lied to and reassured by their bosses, before their bosses fire them and axe the entire department. It's still wrong, but the individual people who reassured the community may have been lied and betrayed just as much as you have been. Or maybe not! The point is, we (you) don't know yet, and may never know.
 
While it's fully understandable that many of you are invested financially, time-wise, and socially, so you favor this specific game above others, it's a fact that other similar games exist that have other similar features, that other people claim is their favorite game.
 
Games are often made by re-assembling common features in different combinations, so while there isn't an exact 1 to 1 clone of YoVille, there are other games that feature house customization (for over twenty years now), and any other single feature you care to mention - just not all in the exact combination you're currently used to, and maybe not in the same art style you have come to love. mellow.png
It does not make YoVille better than other games, and does not make this art style better than other art styles. People get accustomed to and come to love virtual worlds despite the worlds' flaws, because of the great community experiences they have experienced in that world. That doesn't make the world or the game a superior world or game than many of the dozen great alternatives - it just means that the community is great, not the game. 

YoVille, from a game-mechanic perspective, is a frankenstein of re-assembled pieces from other games. Your community is what made YoVille a home to you, not the game itself.
 
If you come to understand that, it'll help you emotionally a great deal. Yes, Zynga betrayed your community. But no, the loss of the game is not the loss of your life. It's like if your home is foreclosed by an immoral bank. Horrible, horrible experience. But the bank isn't taking away your family, just the physical building you have had fond memories in and have become accustomed to. You and your family still have each other and can move someplace else - even if not as great a location as you previously were in. Zynga isn't stealing the YoVille community. You and the YoVille community can still migrate to a different game, or an online forum, and though the new game might not be 100% what you have accustomed yourself to and became familiar with, you can still have many more fantastic experiences and rich relationships moving forward. smile.png

But if you do move to a new game, don't make it a Zynga one. wink.png


#5122997 Zynga Pulls Plug on YoVille - Million$ in YoCash evaporate!

Posted by Servant of the Lord on 12 January 2014 - 12:40 AM

Sure profitability has something about the decision, however I can assure you that a creative mind could figure a way to restructure the business

You don't need to assure me, I already mentioned that same thing. But It's less of an issue of creativity, so much as flexibility that most larger companies lack.
 

They are destroying the consumer confidence in this type of business model.

This (free-to-play) business model was designed from ground-up to exploit consumers. Destroying your confidence in a model that was designed to take advantage of you is probably a good thing.

(Note: Not all free-to-play games are bad and exploitive but many of them are, and the business model has developed around the exploitation more than not)
 

Whats next, Amazon Instant Video decides its not profitable to stay on line - and lock out millions of users from their digital acquisitions.

Why not? It's happened before. Virtual worlds have shut down, and the digital "property" disappeared without even puffs of smoke. Plenty of consumer annoyance... but the business world, and eventually the consumers, moved on.
 

Regardless of TOS, the backlash of such action would be devastating to the online distribution and service industry.

Citation needed? The past thirty years of internet history suggests otherwise.

We have gut feelings about what should happen in a just and fair world, relying on the basic good tendencies of the average human beings. But hey, the selfishness of the average human being outweighs their good tendencies a hundred times over - it's just well hidden. When push comes to shove, decisions get made that leave people lying in the dust while others make a quick buck.
 

It was not long ago that Zynga games represented the majority of FaceBook's revenue, and with 6 million registered users, Yoville's contribution is not an insubstantial share.

That's a four-year old 'ostensibly' 6 million.

 

According to Wikipedia, Zynga has 240 million monthly active users over all their games.
 

Many program managers and entrepreneurs would jump at the offer to tame the beast. She may be unwieldy, however she is a proven winner and I am shocked there is no Yoville2 in plans.  Its more than can be said about most business opportunities.

You're speaking from the perspective of an emotionally-invested fan. Many program managers and entrepreneurs would jump at the offer, if the game was given to them for free, sure. But how many are wanting to spend several million for the "opportunity" to tame a "beast" that they've never met in person and that they don't have full info on?
There are thousands of people who joined the California gold rush. Most didn't become wealthy. Aside from the few who won the geological lottery, the real winners were those providing services and selling equipment to the miners.
 

About finding gold... I have been somewhat successful with my own determination and limited patience in finding gold, and here is the best advice I ever received by one of the most respected Death Valley Prospectors.   http://goldpeeps.com/gp_features_cms.html

I fully agree: "gold is a devilish thing". So important, he mentioned it twice.

Zynga is a big company looking for big gold veins, but smaller more flexible studios can definitely profit from an already-mined mine. But it's not free money: it does require work; it does require up-front investment of time, money, and labor; and it's not a guaranteed success even when all is said and done.

 

And because it requires corporate flexibility that those big companies almost always lack, that's why it doesn't make sense for Zynga to keep running it, even if it might make sense for another company to buy and run it.

 

Zynga is required by law to look after it's shareholders. It can't do charity for the sake of charity, unless it benefits shareholders, because our government forbids it.

Note: Companies can do charitable things... but only if it benefits the company's shareholders in the long run.

 

It's not that you seeing something that everyone else is magically blind to; it's actually that you're seeing only a part of the whole picture, and there are more that goes into these decisions than you'd think. It's not a clear-cut, "Hey, they're leaving nuggets of gold on the ground!". We're talking about greed-filled humans (just like all of us) running a business that is required by the government, by law, to make money for the shareholders above everything else. If they leave nuggets on the ground, it's either fool's gold, or they see more profit elsewhere and don't want to waste the effort.

 

Question: When is it a good idea to hire a plumber for $250 to fix your leaky sink if you know how to fix it yourself in only an hour?

Answer: When you can make more than $250 an hour, it'd be better to devote your hour to earning the money, and paying the plumber. Any money you earn over the plumber's fee (over the $250) is profit. By not hiring the plumber, you lose money - or at least the potential money that could've otherwise been earned.

 

Question: When is it a good idea to close a social game making you $2 ARPU (average revenue per user) per month, with (ostensibly) 6 million subscribers?

Answer: When you think can take the exact same resources you are devoting to running that game, and redirect those some resources to something more profitable.

 

I'm not saying what Zynga did was correct, I'm just answering the shocked, "Why?" question that everyone keeps repeating. Why? Because Zynga feels there is more profit in (Zynga) closing the game, then in (Zynga) running it. Full stop.

And if that is what Zynga thinks, then Zynga is required, by law, to do so. Full stop.






PARTNERS