Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - TheDarkJay

Pages: 1 2 [3] 4 5 ... 118
41
Coding / Re: [C++] Integer to String and Vice Versa
« on: November 26, 2010, 08:01:09 pm »
I'm reasonably confused as to why you're starting out with graphics in C++... That language is probably best started via console apps :\

I have to second this...you're jumping around too quickly.

Third.

You want a really good introduction to C++ game project? Look at Interactive Fiction. Ever read any of the books in the Fighting Fantasy series? Making that simple kind of text-based game makes for a great beginners project.

42
Coding / Re: [C++] Integer to String and Vice Versa
« on: November 20, 2010, 12:33:15 am »
...that's what I did just not in their own functions? :huh: (I just copied those functions straight out of one of my own helper code collections).

for string to into, the atoi() function will take care of it.  For the other way around, do what TDJ said :P

If memory serves, atoi is generally considered the "C" way of doing things whilst stringstream the "++C" way. (++C being a slang-term for "screw C, we love polymorphism!) Whether or not this is a good thing is a matter of opinion xD

43
Coding / Re: [C++] Integer to String and Vice Versa
« on: November 19, 2010, 02:17:25 pm »
The std::stringstream class is a typical way of doing this in C++

Code: [Select]
#include <string>
#include <sstream>

template<typename T> inline std::string ToString(const T& o)
{
     std::stringstream stream; stream << o;
     return stream.str();
}

template<typename T> inline T FromString(const std::string& s)
{
      T o; std::stringstream stream;
      stream << s; stream >> o;
      return o;
}

int main()
{
      int i = 5;
      std::string si = ToString(i);

      std::string age = "7";
      int nage = FromString<int>(age);
      return 0;
}

44
Graphics / Re: Haruhi chan eating a cookie
« on: November 18, 2010, 03:05:09 am »
Aaaa 可愛い-です!!! =^.^=

...sorry, don't know what came over me. Anyway, looks good  8)

45
Coding / Re: [C++] Rooms
« on: November 14, 2010, 09:59:53 pm »
virtual void SomeFunc() = 0; means SomeFunc() is a pure virtual function. It is entirely abstract, so the class containing it can't be created by itself. The child then overrides it and can be created.
See more at: http://en.wikipedia.org/wiki/Virtual_function#Abstract_classes_and_pure_virtual_functions

46
Coding / Re: [C++] Rooms
« on: November 14, 2010, 09:17:15 pm »
Fair enough. I've seen both explicit-always and implicit-explicit-different-implication practices used all over the place. It's usage depends on personal-practice (for solo projects) and party-practice (for group projects).

I just figured it was worth pointing out since Xip either through hecking code apart for presentation or a simple mistake made some inheritance-related errors. The not-declaring-destructor-virtual one can cause some huge memory leakage...
http://en.wikipedia.org/wiki/Virtual_function#Virtual_destructors

Also it's one of those situations C# and D have it right (makes sense, being newer languages and all) with their explicit abstract/virtual/override keywords.

47
Coding / Re: [C++] Rooms
« on: November 14, 2010, 08:21:47 pm »
Personally I find it pretty unclear either way, since it could mean "new virtual function with default decleration" or "override of old virtual" or "I want to provide a new implementation, but if you want even this implementation can be overridden".

Not including the virtual for me is demonstrating "I want to override, and then nothing following is intended override my override".
Including the virtual for me is demonstrating "I want to override, and if anything following wants to that's also totally cool and I have definitely allowed for it".

This is why I said "is not required" instead of "should not be done".

C++0x has introduced it's own tag that you can use to define an overload anyway, so when they gets adopted....yay? :)

48
Coding / Re: [C++] Rooms
« on: November 14, 2010, 08:03:22 pm »
Just some "best practice comments":
Xiphirx, you need to make GameState have a virtual destructor. Any class which can be inherited needs a virtual destructor otherwise the order the destructors get called in can be messed up. And any call of to delete a base* will not call ~child(). Which can be very very bad.
Also if you aren't defining any implementations of "create()" etc. functions in the base GameState, those should be ended with = 0 e.g virtual void update(float delta) =0;

Also the usage of virtual in introState, if this is not intended to ever be inherited, is not required (as later comments show, it's a personal-preference decision here though).

49
Discussion / Re: Philosophical gaming
« on: October 28, 2010, 04:10:19 am »
For all it's faults (bugs and generally being unfinished) that's why I liked KoToR2. It was easy to play the idealistic anti-villian or the misanthropic anti-hero, characters which break the typical "Saint, Sinner or Apathetic" mold set by Bioware. Obsidian in general seem to be better at providing moral "greyness" for player characters.

50
Discussion / Philosophical gaming
« on: October 28, 2010, 03:32:47 am »
Games which, like novels, have a primary purpose of simply making you think. Take for example, Planescape: Torment. A cult classic, with very little emphasis on combat and much ultimately on a simple question:

"What can change the nature of a man?"

A question with so many answers that reveal so much about the person creating the answer. Take me for example, ask me this question and my answer would be profit. What can change the nature of a man? What he stands to gain from making that change. Others would come up which so many different answers, age, time, death, belief, hope, fear, regret, so many possibilities. These kinds of games are, ultimately fascinating. They offer insights into the human condition, and our own depravities.

Knights of the Old Republic 2, Fallout 2, Planescape: Torment, all of these were story based in my opinion. It was the story that interested me, the story that kept me playing, and the choices that story provided that made me play again.

These are the games that we replay because we want to see real differences in our choices, they are highly character based, highly plot heavy, and I think we need more of them. I am interested in what you all think of almost entirely story-driven games, to the point of being almost if not entirely interactive fiction. From a game development point of view, the pros and cons of such games would be a fascinating discussion.

So, what is your opinion on low-action, high-narrative games? What do you think can change the nature of a man? ;)

51
Coding / Re: [GM7] 8-Way Movement?
« on: October 26, 2010, 05:17:14 pm »
Sorry >.< On the other hand, "he" is technically both used to refer to males and also gender neutral...

Vectors are pretty simple to grasp at least at their most basic level, and also pretty vital in games and the like. Most game programming books will at least briefly mention them if you ever wanna take a lookie =) It's things like Matrices that basically make no sense until one day they click...*shudders*

52
Coding / Re: [GM7] 8-Way Movement?
« on: October 26, 2010, 02:28:22 pm »
True. I just thought he may find the vector way easier to remember and understand (It's better to understand the code you use than blindly copy and paste, after all).

As for the box

top left corner of object is placed at a random position between top left corner of box's position and the bottom right corner of the box's position - the width of the object - 1.

Pseudocode:
object.x = random(box.x, box.x + box.width - object.width - 2);
object.y = random(box.y, box.y + box.height - object.height - 2);

53
Coding / Re: [GM7] 8-Way Movement?
« on: October 26, 2010, 03:42:15 am »
Don't need to think of it using trig, just some simple vector mathematics (you get the same value but this one may be easier to understand).

1^2 = 1 = i^2 + j^2
Diagonal so i = j
1 = 2(i^2)
(1/2) = i^2
(1/2)^(1/2) = i

root(0.5) = 0.70710678118654752440084436210485, but you could just approximate that to 0.71 or 0.707 if you preferred.

Due to the use of floating points you'll get a tiny "rounding error" creep into things but it's negligible for these purposes. Obviously the more accurate a value the less rounding error but again, negligible.

I'll call whatever value you use for the root of 0.5 "n" for now. and the speed "s"

Up: x, y - s
Down: x, y + s
Left: x - s, y
Right: x + s, y

Up+Left: x - sn, y - sn
Up+Right: x + sn, y - sn
Down+Left: x - sn, y + sn
Down+Right: x + sn, y + sn

Editors Note: I have had something in the region of 5 vodka and red bulls, two tequila shots, half a bottle of white wine and some as-yet-unidentified licorice-flavoured drink a friend handed me tonight. Not a lot really, but on a close-to-empty stomach...well, as far as I can tell I've sobered up enough to be reasonably sure as to my maths here...maybe I've even hit the Ballmer Peak, who knows? :)

54
Discussion / Re: First Timer
« on: October 19, 2010, 10:19:22 pm »
It maeks gams just lik the pr0s, and it's 3!1!

...okay, my prejudice against GameMaker aside, it depends.

If you have dreams of being or seeming a professional or mainstream-respectable, then pick a programming language such as Java, C#, FreeBASIC or VisualBASIC and learn them. You learn them first. The games and pretty shiny things come afterwards. The harsh truth of the world really is that you have to walk before you can run.

There are RAD tools you can use, if you absolutely must. Personally I'd recommend Construct over GameMaker, but I can be a snob at times. Then again...

55
Coding / Re: Can someone explain c# classes, please?
« on: October 19, 2010, 05:42:34 pm »
I'd recommend not learning with XNA. If you absolutely must have pretty graphics, go for a simpler framework that you can build in rather than having to build from (I've heard good things about SFML).

Personally I'd suggest you try and create a text-based adventure game. I mean a proper one, where you have the cool

You are in a room. There is a fridge, a bed and a book.
> open fridge
The fridge contains one dry potato inside, no lie. Not even bread, jam.
> sleep
You can't get no sleep.

Coding these is actually rather interesting, believe it or not, and it'll introduce you to important concepts without dropping you in the deeper end of things (so-to-speak) =)

56
Coding / Re: Silly or useless things you've coded
« on: October 02, 2010, 03:34:45 pm »
A program that goes full-screen, completely disables the keyboard and prints to the screen:
Keyboard not found.
Press any key to continue.

57
Entertainment / Re: Amnesia: The Dark Descent
« on: September 24, 2010, 07:06:24 pm »
Penumbra: Overture is a good game (Remember the Humble Indie Game Bundle?), this is made by the same company from the same engine and the demo is definitely freaky and gets you on edge ^.^

58
Discussion / Re: Morality in Video Games
« on: September 16, 2010, 06:16:15 pm »
Like I said, you roll against morality. You have a solid chance of still doing the good/bad action, and for actions close to your morality it's a very high chance, but it isn't a guarantee. I mean, you tolerate speech checks? It basically makes your morality like your speech skill for some options =)

59
Discussion / Re: Morality in Video Games
« on: September 16, 2010, 03:43:18 pm »
An idea I had was your morality could actually eliminate decisions. You could try to do the good thing, it's roll against your morality and if you failed the roll you're character would "override" this and do the wrong thing. Likewise a high morality means your character may actually refuse to do horrific acts.

"Father: Please, help me against the bandits and save my children!"
"Bandit Leader: No, join me in slaughtering the children and I will pay you well!"
"Player: [Attempts to say] I will help you, poor sir!"
[Rolls against player's low morality score of 1. Player is an uncaring psychopath so odds are low. Roll fails.]
"Player: Actually I'll just kill all of you..."
"Father: Noooo!"
"Bandit leader: Oooh, this is getting interesting. Kill them both."

"Father: Please, help me against the bandits and save my children!"
"Bandit Leader: No, join me in slaughtering the children and I will pay you well!"
"Player: [Attempts to say] I value money more than lives, your children must die!"
[Rolls against player's high morality score of 8. Player is willing to kill but only in self-defence. Roll fails.]
"Player: I'm sorry, I can't let you hurt these children!"
"Father: Thank you!"
"Bandit leader: Fool. Kill him."

"Father: Please, help me against the bandits and save my children!"
"Bandit Leader: No, join me in slaughtering the children and I will pay you well!"
"Player: [Attempts to say] I value money more than lives, your children must die!"
[Player has a morality of 3, they are willing to kill and do horrific things for personal gain but not completely psychotic. No roll needed]
"Father: Noo!"
"Bandit leader: Smart man."

Perhaps the game would need some kind of "dark passanger"-esque element (yes, i've been reading Darkly Dreaming Dexter), like the beast in Vampire, to explain this but I think it'd be an interesting avenue to explore. Basically players can start off in darkness, or guide themselves into a slide into the abyss, but can't plunge with ease and redemption is likewise difficult.
Obviously one could devise all sorts of morally grey situations. In fact, the WoD system more measures your adherence to the norms of your "ethics system" than your senses of good and evil. Hell, there are some systems that clash entirely with our societies.

Another example may be are you willing to kill a criminal, or try and imprison him. If you imprison him, you save your "morality" but risk him escaping or not being convicted, and living on to cause more pain (think The Joker).

If you kill them, it ends then and there. The "Batman" dilemma, as it were. You may want to kill the !@#$%, but your character's ethics (perhaps a better term?) determines they don't kill except in self-defence. You decide to kill them, the roll succeeds, and your character loses the "thou shalt not kill" morality point. And, as Batman feared, suddenly killing becomes easier. You don't need to roll for cold-blooded murder any more. You did the right thing, but it cost you a part of what kept you human.

60
Discussion / Morality in Video Games
« on: September 15, 2010, 09:53:35 pm »
I'm not going to deny it, I find moral choices in video games fascinating. On the one hand, having options and therefore the illusion of control is very nice. On the other, for fucks sake video games, why is the choice always to be either Jesus, Satan or apathetic?

Our sense of "Morality" is just avoidance of the negative consequences of actions, a moral system in games needs to be designed to reflect that because games have no real consequences anyway, which is why games have to dangle some form of engineered carrot in front of players.

Star Wars: KoToR had simple carrots, dark side powers which hurt enemies and light side which healed and buffed allies. Being light side or dark side was basically a playing style choice. Dark side sometimes had an extra money carrot, but not always. Sometimes you got more from light side.

Mass Effect has two carrots: Being a !@#$% gives you renegade and lets you do more intimidation, being a paragon let's you be more charismatic. But the carrots are the same both ways, being renegade is just funnier to watch most of the time. I can't be the only player he basically did all the big paragon choices but at every other step of the way was a complete !@#$%, just so he could laugh at the bastardry.

Both these carrots give players "the weaknesses of amorality", being a grey made you inherently weaker which sucked.

Personally I'd like to see a game implement a morality system akin to that of the World of Darkness: One-way. Being cruel cost you morality, but when only your current morality was above the level of cruelty of that action. A common thief would not lose any more morality from stealing, but if they ever kill someone they'd take a plunge. Also it means the game can easily keep track of how to treat the player, you can't "puppy-poke" your way to becoming the Lord of the Sith.

Of course some kinds of carrots would be required. WoD implements "derangements", as your character goes more (a/im)moral they go insane(r). This means players have to balance the rewards of their "evil" actions with the rewards of such actions.

Pages: 1 2 [3] 4 5 ... 118

Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.071 seconds with 35 queries.