Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

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 - dreadmullet

Pages: 1 ... 10 11 [12] 13 14 ... 28
166
That actually keeps tripping me up, lately. I'm so used to variable and pointer being identical that it fields weird to have to explicitly declare them. The implicit creation of new stuff on assignment just feels odd.

I see what you did there.

167
Fantastic wall of text, Alway. I love reading stuff like that. All those links were awesome.


Anyway, I have yet another complex question about the basics of C++.

Code: [Select]
class Thing{

// stuff

};

Thing one;

int main(){

Thing two = Thing();

one = two; // this here

}

What exactly happens at the commented line? Does one reference the same thing as two? Or does it create a copy or something?

168
Spoiler (click to show/hide)

It's always annoyed me how the sound positioning in first-person games is always crap. If an NPC is two floors above me, I can somehow hear their footsteps perfectly clearly. If anyone fires a gun in Counter-Strike, I know exactly where they are. And yet people spend hundreds of dollars on surround sound setups.

That looks amazing. Hopefully this technique will eventually become standard for all FPSs. Wait, that video is from 2009... Damnit game developers, stop spending money on better graphics. The graphics equivalent of today's sound is like having unshaded, untextured models.

169
Thanks! You are all awesome people.

Also of note, the OS will typically clean up anything you forgot upon the program exiting; though relying on this is typically considered bad form.

Your use of the word "typically" frightens me. At times, I have not turned off my computer for months at a time. If I'm always launching and exiting a program that has lots of memory leaks, will the OS always clean up after the program, or...?

170
I've a question about C++ and dynamic memory: I've been thinking that whenever there is a "new" somewhere in the code, there should always, always be a "delete" or "delete[]" somewhere else. Is this a reasonable guideline?

171
Your first link got me going in the right direction. Thanks!

I think these two lines are basically the same:

Code: (C#) [Select]
if(Ball is T)

Code: (C++) [Select]
if(typeid(Ball) == typeid(T))

172
So apparently I can just do "new T", like this:

Code: (C++) [Select]
template<typename T>
T Instantiate(){
     
     return *(new T);
     
}

That's useful, but it's just part of what I'm doing. What if I want to compare if a variable is of a certain type? In C# it looks like this:

Code: (C#) [Select]
bool Test<T>(){
     
     Ball ball = new Ball();
     
     return ball is T;
     
}

173
I would like to instantiate an arbitrary class in C++. I know how to do this in C#:

Code: [Select]
T Instantiate<T>() where T : new(){
     
     T instance = new T();
     
     return instance;
     
}

The above code creates an instance of the type passed to it. If you wanted to make a Ball, it would work like this:

Code: [Select]
Ball b = Instantiate<Ball>();


How do I do this with C++? I am aware of templates, but there has to be a better way.

174
My comp makes weird loud grinding noises when I turn it on, they quiet down in about 20 mins but it's still pretty loud. Thinking the fan is loose or something, but I already cleaned the comp of dust (took it completely apart, cleaned fans + heatsink, etc) but the noise is still there. What do?

I recently had two 120mm fans start to do this to me. They would make noise like you describe, but I could fiddle with them to stop the noise. Really annoying. Luckily I had two recently purchased fans I was using, so they were replaced without a problem. I think it's a good idea to buy a bunch of cheap fans in case any of the ones you're using break.

175
My current 10 dwarf squad is called The Humorous Standards.


Eh, I'm still pretty new compared to you guys.

176
Oh, Java, that must be where I heard it from; probably one of the programming threads on here. Also, with my forgetting the quotation marks, you can tell I rely on my F7 key too much...

177
Excellent tutorial!

One thing I don't understand (I've done suprising little with C++ strings) is this:

Code: [Select]
if(function == "add")
I thought you had to do
Code: [Select]
if(function.compare(add) == 0)or else it wouldn't work.

178
General Discussion / Re: Random Magical Effect Generator
« on: May 30, 2012, 02:08:54 pm »
Quote
There is a sudden eclipse permanently.
The sun vanished?

Quote
You become more fleetfooted and then you punch the first person you see repeatedly.
In other words, I become The Scout.

Quote
Your hair falls off for the rest of the day.
Yay, free haircuts.

Quote
You become a ghost permanently.
D:

Quote
A strong wind picks up and then you burst into flames.
The wind was so strong the friction set me on fire.

Quote
Your teeth turn golden and then your intelligence drops repeatedly.
[Insert rapper joke here.]

Quote
Your head falls off and then you kiss the person closest to you on the lips.
What

179
Other Games / Re: 0x10^c: Notch's Game In Space
« on: May 16, 2012, 12:29:12 pm »
The next topic we should discuss is the practically application for one man fighters.

Drones are better. End of story.
- Humans can only take about 9 Gs before blacking out. Drones don't have this problem. They can accelerate at 1000 Gs if the ship allows it to.
- No need to make room for squishy living things. Smaller space, less mass.
- Copies can be made easily, while humans are irreplaceable. (Which makes me wonder how death in 0x10^c will work...)

The only problem would be developing an AI that is good enough (which, let's be honest, some expert AI programmer will develop within a day).

180
> You find two rejected gods roaming the universe. The first is Iifyras, Goddess of Lazyness, and the other is Doardham, God of Being A Dick. You attempt to recruit them to your empty pantheon.

> You gather at your pepperjack moon (now swiss cheese from the planetary fragments) and explain what's going down.


Spoiler (click to show/hide)

Pages: 1 ... 10 11 [12] 13 14 ... 28