Vector arrays? ( luigi is a square lolz )

Anything related in any way to game development as a whole is welcome here. Tell us about your game, grace us with your project, show us your new YouTube video, etc.

Moderator: PC Supremacists

User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: Vector arrays? ( luigi is a square lolz )

Post by Falco Girgis »

N64vSNES wrote:
GyroVorbis wrote:
Khearts wrote:I thought NULL == 0...?
It does. That's not the point, though.

If comparing a pointer to 0 were a good practice, why the hell would the keyword/macro NULL even exist? It's not a good practice.
I didn't think that assigning pointers to 0 was that big of a deal since the NULL marco is defined as 0 to begin with.
I suppose its better for readability so I'll start using NULL.


And yes I changed it from
std::Vector <Eternal::Npc> Npcs;
to
std::Vector <Eternal::Npc> Npcs;

Then dynamicly allocate a NPC and pass that onto the array and deallocate it when the NPC gets removed, this wasn't the issue?
First of all, I'm pretty sure you are forgetting an asterisk in your second line there.

Second of all, your previous post did not mention that you actually changed the datatype of the vector itself to contain NPC pointers, you simply said that you began PASSING a pointer.

Third of all, this means that however you were shallow copying one NPC to another was fucking the texture up. While the dynamic method (that you are using now), is probably preferred, for performance reasons (you aren't literally copying the data from point A to B upon insertion), the previous method should have worked as well...
N64vSNES
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 632
Joined: Thu Aug 12, 2010 11:25 am

Re: Vector arrays? ( luigi is a square lolz )

Post by N64vSNES »

GyroVorbis wrote:
N64vSNES wrote:
GyroVorbis wrote:
Khearts wrote:I thought NULL == 0...?
It does. That's not the point, though.

If comparing a pointer to 0 were a good practice, why the hell would the keyword/macro NULL even exist? It's not a good practice.
I didn't think that assigning pointers to 0 was that big of a deal since the NULL marco is defined as 0 to begin with.
I suppose its better for readability so I'll start using NULL.


And yes I changed it from
std::Vector <Eternal::Npc> Npcs;
to
std::Vector <Eternal::Npc> Npcs;

Then dynamicly allocate a NPC and pass that onto the array and deallocate it when the NPC gets removed, this wasn't the issue?
First of all, I'm pretty sure you are forgetting an asterisk in your second line there.

Second of all, your previous post did not mention that you actually changed the datatype of the vector itself to contain NPC pointers, you simply said that you began PASSING a pointer.

Third of all, this means that however you were shallow copying one NPC to another was fucking the texture up. While the dynamic method (that you are using now), is probably preferred, for performance reasons (you aren't literally copying the data from point A to B upon insertion), the previous method should have worked as well...
Yeah sorry my bad, I meant to say

from this
std::Vector <Eternal::Npc> Npcs;
to this
std::Vector <Eternal::Npc*> Npcs;

:P I've not had much coffee today lol

So which method would you recommend?
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Vector arrays? ( luigi is a square lolz )

Post by dandymcgee »

N64vSNES wrote:So which method would you recommend?
Did you even read Gyro's post?
GyroVorbis wrote:While the dynamic method (that you are using now), is probably preferred, for performance reasons (you aren't literally copying the data from point A to B upon insertion), the previous method should have worked as well...
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
N64vSNES
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 632
Joined: Thu Aug 12, 2010 11:25 am

Re: Vector arrays? ( luigi is a square lolz )

Post by N64vSNES »

dandymcgee wrote:
N64vSNES wrote:So which method would you recommend?
Did you even read Gyro's post?
GyroVorbis wrote:While the dynamic method (that you are using now), is probably preferred, for performance reasons (you aren't literally copying the data from point A to B upon insertion), the previous method should have worked as well...
GyroVorbis wrote:While the dynamic method (that you are using now), is probably preferred
the previous method should have worked as well
Dosen't sound like he's backing any perticular method, I was asking what method he personaly would use.
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Vector arrays? ( luigi is a square lolz )

Post by dandymcgee »

N64vSNES wrote: Dosen't sound like he's backing any perticular method, I was asking what method he personaly would use.
Then what does "probably preferred, for performance reasons (you aren't literally copying the data from point A to B upon insertion)" sound like to you?

Perhaps you should grab a dictionary and look up "preferred" vs. "works".
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
N64vSNES
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 632
Joined: Thu Aug 12, 2010 11:25 am

Re: Vector arrays? ( luigi is a square lolz )

Post by N64vSNES »

dandymcgee wrote:
N64vSNES wrote: Dosen't sound like he's backing any perticular method, I was asking what method he personaly would use.
Then what does "probably preferred, for performance reasons (you aren't literally copying the data from point A to B upon insertion)" sound like to you?

Perhaps you should grab a dictionary and look up "preferred" vs. "works".
Perhaps you need to chill the fuck out?

Now isn't that better ;)
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Vector arrays? ( luigi is a square lolz )

Post by dandymcgee »

N64vSNES wrote: Perhaps you need to chill the fuck out?

Now isn't that better ;)
No need to get hostile. Simply pointing out that your question was already answered by Falco. Apparently you missed it the first time through.

Every heard the phrase, "Ask me a dumb question, I'll give you a dumb answer."?
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
N64vSNES
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 632
Joined: Thu Aug 12, 2010 11:25 am

Re: Vector arrays? ( luigi is a square lolz )

Post by N64vSNES »

dandymcgee wrote:
N64vSNES wrote: Perhaps you need to chill the fuck out?

Now isn't that better ;)
No need to get hostile. Simply pointing out that your question was already answered by Falco. Apparently you missed it the first time through.

Every heard the phrase, "Ask me a dumb question, I'll give you a dumb answer."?
I'm not trying to get "hostile" but what your not getting is Gyro said dynamicly allocating the NPC every time you want to add one to the vector would slow take more processing power which is fair enough but he also said that method is probably "preferred", what I'm asking is what he would use because I'm not sure if he is saying

"No I wouldn't use that method because of the extra processing power it needs"
or he's saying
"I wouldn't use this method because of the extra processing power however its probably the generally prefered so its cool"

No need to start world war 3 eh? :lol:
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: Vector arrays? ( luigi is a square lolz )

Post by Falco Girgis »

N64vSNES wrote:Gyro said dynamicly allocating the NPC every time you want to add one to the vector would slow take more processing power
GyroVorbis wrote:While the dynamic method (that you are using now), is probably preferred, for performance reasons (you aren't literally copying the data from point A to B upon insertion)
Orly?
N64vSNES
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 632
Joined: Thu Aug 12, 2010 11:25 am

Re: Vector arrays? ( luigi is a square lolz )

Post by N64vSNES »

GyroVorbis wrote:
N64vSNES wrote:Gyro said dynamicly allocating the NPC every time you want to add one to the vector would slow take more processing power
GyroVorbis wrote:While the dynamic method (that you are using now), is probably preferred, for performance reasons (you aren't literally copying the data from point A to B upon insertion)
Orly?
Ok my bad I totally misread it even the second time :oops:

So dynamicly allocating them is the best way to go?
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Vector arrays? ( luigi is a square lolz )

Post by dandymcgee »

N64vSNES wrote:
GyroVorbis wrote:
N64vSNES wrote:Gyro said dynamicly allocating the NPC every time you want to add one to the vector would slow take more processing power
GyroVorbis wrote:While the dynamic method (that you are using now), is probably preferred, for performance reasons (you aren't literally copying the data from point A to B upon insertion)
Orly?
Ok my bad I totally misread it even the second time :oops:

So dynamicly allocating them is the best way to go?
Yes. I see what you mean, Falco may have abused his commas just a bit.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
N64vSNES
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 632
Joined: Thu Aug 12, 2010 11:25 am

Re: Vector arrays? ( luigi is a square lolz )

Post by N64vSNES »

dandymcgee wrote:
N64vSNES wrote:
GyroVorbis wrote:
N64vSNES wrote:Gyro said dynamicly allocating the NPC every time you want to add one to the vector would slow take more processing power
GyroVorbis wrote:While the dynamic method (that you are using now), is probably preferred, for performance reasons (you aren't literally copying the data from point A to B upon insertion)
Orly?
Ok my bad I totally misread it even the second time :oops:

So dynamicly allocating them is the best way to go?
Yes. I see what you mean, Falco may have abused his commas just a bit.
Yeah lol, I'm still bad at misreading things.

Thanks though guys I learn somthing new every day since I thought dynamicly allocating all that crap would be slower than copying the data :bow:
User avatar
adikid89
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 94
Joined: Tue Apr 27, 2010 6:59 am
Current Project: small tiny-mini projects
Favorite Gaming Platforms: PC I guess...
Programming Language of Choice: c++

Re: Vector arrays? ( luigi is a square lolz )

Post by adikid89 »

N64vSNES wrote:Yeah lol, I'm still bad at misreading things.
:lol: I think you meant "Yeah lol, I'm pretty good at misreading things." :)
My first game C++/SDL Yoshi Combat! = http://www.youtube.com/watch?v=HQ9mMBEWSZg
==============================================================
Image
N64vSNES
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 632
Joined: Thu Aug 12, 2010 11:25 am

Re: Vector arrays? ( luigi is a square lolz )

Post by N64vSNES »

adikid89 wrote:
N64vSNES wrote:Yeah lol, I'm still bad at misreading things.
:lol: I think you meant "Yeah lol, I'm pretty good at misreading things." :)
Meh, thats kinda how we talk round'er ;)
Post Reply