• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 00:45
CEST 06:45
KST 13:45
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
Team Liquid Map Contest #22 - The Finalists14[ASL21] Ro16 Preview Pt1: Fresh Flow9[ASL21] Ro24 Preview Pt2: News Flash10[ASL21] Ro24 Preview Pt1: New Chaos0Team Liquid Map Contest #22 - Presented by Monster Energy21
Community News
2026 GSL Season 1 Qualifiers11Maestros of the Game 2 announced32026 GSL Tour plans announced11Weekly Cups (April 6-12): herO doubles, "Villains" prevail1MaNa leaves Team Liquid21
StarCraft 2
General
MaNa leaves Team Liquid 2026 GSL Tour plans announced Team Liquid Map Contest #22 - The Finalists Weekly Cups (April 6-12): herO doubles, "Villains" prevail Oliveira Would Have Returned If EWC Continued
Tourneys
GSL CK: More events planned pending crowdfunding 2026 GSL Season 1 Qualifiers Sparkling Tuna Cup - Weekly Open Tournament Master Swan Open (Global Bronze-Master 2) SEL Doubles (SC Evo Bimonthly)
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players [M] (2) Frigid Storage
External Content
Mutation # 521 Memorable Boss The PondCast: SC2 News & Results Mutation # 520 Moving Fees Mutation # 519 Inner Power
Brood War
General
Data needed ASL21 General Discussion BGH Auto Balance -> http://bghmmr.eu/ Pros React To: Tulbo in Ro.16 Group A RepMastered™: replay sharing and analyzer site
Tourneys
[Megathread] Daily Proleagues Escore Tournament StarCraft Season 2 [ASL21] Ro16 Group A [ASL21] Ro16 Group B
Strategy
Simple Questions, Simple Answers What's the deal with APM & what's its true value Any training maps people recommend? Fighting Spirit mining rates
Other Games
General Games
Nintendo Switch Thread General RTS Discussion Thread Battle Aces/David Kim RTS Megathread Stormgate/Frost Giant Megathread Starcraft Tabletop Miniature Game
Dota 2
The Story of Wings Gaming Official 'what is Dota anymore' discussion
League of Legends
G2 just beat GenG in First stand
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas TL Mafia Community Thread Five o'clock TL Mafia
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread Things Aren’t Peaceful in Palestine YouTube Thread Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
Anime Discussion Thread [Req][Books] Good Fantasy/SciFi books [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread McBoner: A hockey love story Formula 1 Discussion Cricket [SPORT]
World Cup 2022
Tech Support
[G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
Reappraising The Situation T…
TrAiDoS
lurker extra damage testi…
StaticNine
Broowar part 2
qwaykee
Funny Nicknames
LUCKY_NOOB
Iranian anarchists: organize…
XenOsky
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1368 users

The Big Programming Thread - Page 381

Forum Index > General Forum
Post a Reply
Prev 1 379 380 381 382 383 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
delHospital
Profile Blog Joined December 2010
Poland261 Posts
Last Edited: 2013-10-25 15:10:59
October 25 2013 15:06 GMT
#7601
The server most likely runs at 20 frames/s or something around that number (for example D2 has 25 frames, HoN has 20, SC2 has 16 (but SC2 is not client-server), and I haven't heard of a big game that does calculations in real time). So if both ancients die in a single frame, it's likely that the server will declare the game a draw.

E: It doesn't really have much to do with event queues. The server will do whatever is to be done for each hero, creep, building, missile, spell, etc. in every single frame.
devilesk
Profile Joined May 2005
United States140 Posts
October 25 2013 15:19 GMT
#7602
On October 25 2013 23:57 adwodon wrote:
He made a reasonable assumption as to why they wouldn't be forced to include a draw condition (ie the winner could always accurately be determined)

Is that actually true though? How do you determine a "winner" if both Ancients die in the same frame other than arbitrarily picking one.
www.devilesk.com/dota2
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
Last Edited: 2013-10-25 15:28:23
October 25 2013 15:27 GMT
#7603
On October 26 2013 00:19 devilesk wrote:
Show nested quote +
On October 25 2013 23:57 adwodon wrote:
He made a reasonable assumption as to why they wouldn't be forced to include a draw condition (ie the winner could always accurately be determined)

Is that actually true though? How do you determine a "winner" if both Ancients die in the same frame other than arbitrarily picking one.

He would obviously have to go by the time at which the respective event (the action leading to the killing blow to the ancient) sent by a client enters the event queue on the server. Which isn't really accurate since there are things like latency. There is a definite order of events in the queue, but that order can be considered random when it comes down to a few milliseconds of difference between recieving the events.
If you have a good reason to disagree with the above, please tell me. Thank you.
delHospital
Profile Blog Joined December 2010
Poland261 Posts
October 25 2013 15:41 GMT
#7604
On October 26 2013 00:27 spinesheath wrote:
Show nested quote +
On October 26 2013 00:19 devilesk wrote:
On October 25 2013 23:57 adwodon wrote:
He made a reasonable assumption as to why they wouldn't be forced to include a draw condition (ie the winner could always accurately be determined)

Is that actually true though? How do you determine a "winner" if both Ancients die in the same frame other than arbitrarily picking one.

He would obviously have to go by the time at which the respective event (the action leading to the killing blow to the ancient) sent by a client enters the event queue on the server. Which isn't really accurate since there are things like latency. There is a definite order of events in the queue, but that order can be considered random when it comes down to a few milliseconds of difference between recieving the events.

Uh. And what if it's killed by a creep? Then there's no packet to check the sequence number...
adwodon
Profile Blog Joined September 2010
United Kingdom592 Posts
October 25 2013 16:16 GMT
#7605
On October 26 2013 00:27 spinesheath wrote:
Show nested quote +
On October 26 2013 00:19 devilesk wrote:
On October 25 2013 23:57 adwodon wrote:
He made a reasonable assumption as to why they wouldn't be forced to include a draw condition (ie the winner could always accurately be determined)

Is that actually true though? How do you determine a "winner" if both Ancients die in the same frame other than arbitrarily picking one.

He would obviously have to go by the time at which the respective event (the action leading to the killing blow to the ancient) sent by a client enters the event queue on the server. Which isn't really accurate since there are things like latency. There is a definite order of events in the queue, but that order can be considered random when it comes down to a few milliseconds of difference between recieving the events.

Which makes the whole debate pointless. Any number of things in the call stack could cause an unintentional delay of a few ms, splitting hairs over it is pointless so unless they were the most anal devs in the world with nothing more important to work on that would be entirely sufficient.

No one would ever know and the situation is so unlikely to begin with why does it even matter?
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
October 25 2013 16:29 GMT
#7606
On October 26 2013 00:41 delHospital wrote:
Show nested quote +
On October 26 2013 00:27 spinesheath wrote:
On October 26 2013 00:19 devilesk wrote:
On October 25 2013 23:57 adwodon wrote:
He made a reasonable assumption as to why they wouldn't be forced to include a draw condition (ie the winner could always accurately be determined)

Is that actually true though? How do you determine a "winner" if both Ancients die in the same frame other than arbitrarily picking one.

He would obviously have to go by the time at which the respective event (the action leading to the killing blow to the ancient) sent by a client enters the event queue on the server. Which isn't really accurate since there are things like latency. There is a definite order of events in the queue, but that order can be considered random when it comes down to a few milliseconds of difference between recieving the events.

Uh. And what if it's killed by a creep? Then there's no packet to check the sequence number...

Then he takes some other arbitrary ordering. There probably is a list of minions or something to that effect. It's pointless, and as I said before I would assume that draws are possible in DotA2.
If you have a good reason to disagree with the above, please tell me. Thank you.
LaNague
Profile Blog Joined April 2010
Germany9118 Posts
October 25 2013 18:38 GMT
#7607
Is anyone familiar with microsoft licenses?

I have visual studio from the msdnaa license installed at home because of convenience.
The company i work for also has microsoft licenses for everyone.


Is it ok to use my stuff at home or do i have to swap accounts or something?
I mean, i theoretically have all the licenses. Are my msdnaa projects watermarked if i use a non commercialö license?
baHmi
Profile Joined April 2012
22 Posts
October 25 2013 18:44 GMT
#7608
Projects created/edited with MSDNAA subscription installs of visual studio don't leave any watermarks, as far as the IDE is concerned, you're running a legit Professional volume license.

However if you wanted to do everything "by the book", I would suggest just getting a license from your work and reinstall VS with that. I've never heard of MS doing audits at home computers, but technically you're not doing stuff according to the license.
LaNague
Profile Blog Joined April 2010
Germany9118 Posts
October 25 2013 19:11 GMT
#7609
ok thanks, ill leave it for now.

I was just worried that i might "compromise" our terribly expensive program with my small contribution
Reggiegigas
Profile Joined August 2010
234 Posts
Last Edited: 2013-10-25 20:49:36
October 25 2013 20:40 GMT
#7610
Hlelo.

studied c++ for a while, wanted to do something on my own. So I'm making a game. and I have a class for characters in the game. And I want to somehow program a way for the program to know about family bonds. like i.e. if a guy's brother has a child, the game should be able to 'get' his new niece object. etc.

it would both affect relationships and various other variables for characters and I'd like to be able to display family free for a certain dynasty (you choose family name when the game starts).

how do I do this? I thought about having some private variables for a character object's siblings, parents, and children, and then somehow telescopically using functions off that to find out grandchildren/cousins/etc. like arrays referencing their position in the object array I guess? I'm just unsure what would be best.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
Last Edited: 2013-10-25 20:54:34
October 25 2013 20:52 GMT
#7611
On October 26 2013 05:40 Reggiegigas wrote:
Hlelo.

studied c++ for a while, wanted to do something on my own. So I'm making a game. and I have a class for characters in the game. And I want to somehow program a way for the program to know about family bonds. like i.e. if a guy's brother has a child, the game should be able to 'get' his new niece object. etc.

it would both affect relationships and various other variables for characters and I'd like to be able to display family free for a certain dynasty (you choose family name when the game starts).

how do I do this? I thought about having some private variables for a character object's siblings, parents, and children, and then somehow telescopically using functions off that to find out grandchildren/cousins/etc.

You seem to be on the right track. Store the bare minimum of information - parents, children, marriage partner, and derive the other family members using functions. These functions can be inside the character class or outside (accessing the publicly readable bare minimum information). Choose which one fits your design best.
If you have a good reason to disagree with the above, please tell me. Thank you.
LaNague
Profile Blog Joined April 2010
Germany9118 Posts
Last Edited: 2013-10-25 21:13:14
October 25 2013 21:10 GMT
#7612
On October 26 2013 05:40 Reggiegigas wrote:
Hlelo.

studied c++ for a while, wanted to do something on my own. So I'm making a game. and I have a class for characters in the game. And I want to somehow program a way for the program to know about family bonds. like i.e. if a guy's brother has a child, the game should be able to 'get' his new niece object. etc.

it would both affect relationships and various other variables for characters and I'd like to be able to display family free for a certain dynasty (you choose family name when the game starts).

how do I do this? I thought about having some private variables for a character object's siblings, parents, and children, and then somehow telescopically using functions off that to find out grandchildren/cousins/etc. like arrays referencing their position in the object array I guess? I'm just unsure what would be best.



family relations are defined by the parents, so maybe its enough to have each person have 2 pointer that point to the parents.
Plus partner, since they are the only relation not blood related. And maybe children for searching in the other direction, depending on your needs.
Reggiegigas
Profile Joined August 2010
234 Posts
Last Edited: 2013-10-26 12:44:28
October 26 2013 10:08 GMT
#7613
On October 26 2013 05:52 spinesheath wrote:
Show nested quote +
On October 26 2013 05:40 Reggiegigas wrote:
Hlelo.

studied c++ for a while, wanted to do something on my own. So I'm making a game. and I have a class for characters in the game. And I want to somehow program a way for the program to know about family bonds. like i.e. if a guy's brother has a child, the game should be able to 'get' his new niece object. etc.

it would both affect relationships and various other variables for characters and I'd like to be able to display family free for a certain dynasty (you choose family name when the game starts).

how do I do this? I thought about having some private variables for a character object's siblings, parents, and children, and then somehow telescopically using functions off that to find out grandchildren/cousins/etc.

You seem to be on the right track. Store the bare minimum of information - parents, children, marriage partner, and derive the other family members using functions. These functions can be inside the character class or outside (accessing the publicly readable bare minimum information). Choose which one fits your design best.


Another thing I was thinking about, how to handle characters dying? I had been thinking of moving them to a separate array for all the 'dead' objects. But I suppose that would mean I would have to change a lot of other objects' family relations variables? I'm not sure... Maybe I should just have them all in the same array and not move them anywhere to keep things simple and bug resistant, heh.

Another question: I want to have a private array variable for characters that contain their traits and temporary modifiers, for example a trait that is "bad opinions" towards another character object. So would I have to make this a two-dimensional array? I've never made one of those before but as I understand it, this would allow to make it so each of these trait values would also be able to hold a) a value that points towards which other character object it applies to (if any), then b) a counter thing that counts down with each turn of the game so the trait can be removed when the time reaches zero.


Also, I was considering getting an android tablet to read programming docs on when traveling + possibly coding if there's a decent IDE. Thoughts?
adwodon
Profile Blog Joined September 2010
United Kingdom592 Posts
Last Edited: 2013-10-26 15:44:15
October 26 2013 15:43 GMT
#7614
On October 26 2013 19:08 Reggiegigas wrote:
Another thing I was thinking about, how to handle characters dying? I had been thinking of moving them to a separate array for all the 'dead' objects. But I suppose that would mean I would have to change a lot of other objects' family relations variables? I'm not sure... Maybe I should just have them all in the same array and not move them anywhere to keep things simple and bug resistant, heh.

There may well be a better way of doing things and I suppose it depends on your implementation but I see no reason why you couldn't just give each object a state flag which tells you if its dead.


On October 26 2013 19:08 Reggiegigas wrote:
Another question: I want to have a private array variable for characters that contain their traits and temporary modifiers, for example a trait that is "bad opinions" towards another character object. So would I have to make this a two-dimensional array? I've never made one of those before but as I understand it, this would allow to make it so each of these trait values would also be able to hold a) a value that points towards which other character object it applies to (if any), then b) a counter thing that counts down with each turn of the game so the trait can be removed when the time reaches zero.

You could just make a 'relationship' struct or object which contains a pointer to both entities and a state flag?
If you're using C then get some #defines going for readability.
You could then just have an array of pointers to each relationship relevant to that character. Again I'm sure there are better solutions though, I don't engineer these things professionally

On October 26 2013 19:08 Reggiegigas wrote:
Also, I was considering getting an android tablet to read programming docs on when traveling + possibly coding if there's a decent IDE. Thoughts?

Tablets are great for reading but an IDE on one sounds laughable, if that's your prime motivation just get a windows 8 tablet which can attach to a keyboard (ie its a laptop / tablet hybrid) although personally I still refuse to run Visual Studio (my IDE of choice) on anything with less than 2 screens. Text editor sure, go nuts but a full blown IDE sounds daft, you're not going to debug anything on a tablet so why bother.

Tablets are fine for reading though, and considering the size of a lot of books and the nature of learning these days you can do a lot of cool things like watch webcasts and read articles on the go which is nice.
Reggiegigas
Profile Joined August 2010
234 Posts
October 26 2013 16:16 GMT
#7615
Ah okay, was hoping someone would have made a half decent IDE for android by this point.

Thanks for the relationship struct thing idea. The idea of having it separately from the objects appeals to me. I'm not sure how to code that but I'll try googling.
besez
Profile Joined June 2010
Sweden54 Posts
October 26 2013 16:23 GMT
#7616
On October 27 2013 01:16 Reggiegigas wrote:
Ah okay, was hoping someone would have made a half decent IDE for android by this point.

Thanks for the relationship struct thing idea. The idea of having it separately from the objects appeals to me. I'm not sure how to code that but I'll try googling.


There actually is a "decent" IDE for Android https://play.google.com/store/apps/details?id=com.aide.ui&hl=sv

Probably hard to use without mouse & keyboard though.
haypro fighting
Reggiegigas
Profile Joined August 2010
234 Posts
October 26 2013 18:37 GMT
#7617
On October 27 2013 01:23 besez wrote:
Show nested quote +
On October 27 2013 01:16 Reggiegigas wrote:
Ah okay, was hoping someone would have made a half decent IDE for android by this point.

Thanks for the relationship struct thing idea. The idea of having it separately from the objects appeals to me. I'm not sure how to code that but I'll try googling.


There actually is a "decent" IDE for Android https://play.google.com/store/apps/details?id=com.aide.ui&hl=sv

Probably hard to use without mouse & keyboard though.

Aha. I might try that. I was thinking about ordering a tablet that comes with a keyboard. Adding a bluetooth mouse on top is nothing difficult.
LaNague
Profile Blog Joined April 2010
Germany9118 Posts
Last Edited: 2013-10-26 21:13:36
October 26 2013 21:09 GMT
#7618
On October 26 2013 19:08 Reggiegigas wrote:
Show nested quote +
On October 26 2013 05:52 spinesheath wrote:
On October 26 2013 05:40 Reggiegigas wrote:
Hlelo.

studied c++ for a while, wanted to do something on my own. So I'm making a game. and I have a class for characters in the game. And I want to somehow program a way for the program to know about family bonds. like i.e. if a guy's brother has a child, the game should be able to 'get' his new niece object. etc.

it would both affect relationships and various other variables for characters and I'd like to be able to display family free for a certain dynasty (you choose family name when the game starts).

how do I do this? I thought about having some private variables for a character object's siblings, parents, and children, and then somehow telescopically using functions off that to find out grandchildren/cousins/etc.

You seem to be on the right track. Store the bare minimum of information - parents, children, marriage partner, and derive the other family members using functions. These functions can be inside the character class or outside (accessing the publicly readable bare minimum information). Choose which one fits your design best.


Another thing I was thinking about, how to handle characters dying? I had been thinking of moving them to a separate array for all the 'dead' objects. But I suppose that would mean I would have to change a lot of other objects' family relations variables? I'm not sure... Maybe I should just have them all in the same array and not move them anywhere to keep things simple and bug resistant, heh.

Another question: I want to have a private array variable for characters that contain their traits and temporary modifiers, for example a trait that is "bad opinions" towards another character object. So would I have to make this a two-dimensional array? I've never made one of those before but as I understand it, this would allow to make it so each of these trait values would also be able to hold a) a value that points towards which other character object it applies to (if any), then b) a counter thing that counts down with each turn of the game so the trait can be removed when the time reaches zero.


Also, I was considering getting an android tablet to read programming docs on when traveling + possibly coding if there's a decent IDE. Thoughts?




maybe you can make a class "staus effect". You can make a simple array that points to objects of that class and the objects all the stuff like opinion modifiers and target person in them.
You could even maaybe make a general status effect and then derive other classes from it.



Also, i recetnly got the new Nexus 7 and i love it. I just drag drop all the PDFs into google drive and then i can just load them on the Nexus if i need them. So much better than having paper or books with me all the time.
killa_robot
Profile Joined May 2010
Canada1884 Posts
Last Edited: 2013-10-26 21:21:09
October 26 2013 21:19 GMT
#7619
On October 26 2013 19:08 Reggiegigas wrote:
Show nested quote +
On October 26 2013 05:52 spinesheath wrote:
On October 26 2013 05:40 Reggiegigas wrote:
Hlelo.

studied c++ for a while, wanted to do something on my own. So I'm making a game. and I have a class for characters in the game. And I want to somehow program a way for the program to know about family bonds. like i.e. if a guy's brother has a child, the game should be able to 'get' his new niece object. etc.

it would both affect relationships and various other variables for characters and I'd like to be able to display family free for a certain dynasty (you choose family name when the game starts).

how do I do this? I thought about having some private variables for a character object's siblings, parents, and children, and then somehow telescopically using functions off that to find out grandchildren/cousins/etc.

You seem to be on the right track. Store the bare minimum of information - parents, children, marriage partner, and derive the other family members using functions. These functions can be inside the character class or outside (accessing the publicly readable bare minimum information). Choose which one fits your design best.


Another thing I was thinking about, how to handle characters dying? I had been thinking of moving them to a separate array for all the 'dead' objects. But I suppose that would mean I would have to change a lot of other objects' family relations variables? I'm not sure... Maybe I should just have them all in the same array and not move them anywhere to keep things simple and bug resistant, heh.

Another question: I want to have a private array variable for characters that contain their traits and temporary modifiers, for example a trait that is "bad opinions" towards another character object. So would I have to make this a two-dimensional array? I've never made one of those before but as I understand it, this would allow to make it so each of these trait values would also be able to hold a) a value that points towards which other character object it applies to (if any), then b) a counter thing that counts down with each turn of the game so the trait can be removed when the time reaches zero.


Also, I was considering getting an android tablet to read programming docs on when traveling + possibly coding if there's a decent IDE. Thoughts?


For the relatives/relationships, why not create an enum that holds the name/reference to person, and a relationship type, etc. Then just create a list of said enum in the character class (you could even order the list by who has the "closest" relationship to the character).

For dying characters, just have a status flag on them that can be set to dead.
Reggiegigas
Profile Joined August 2010
234 Posts
Last Edited: 2013-10-26 22:55:29
October 26 2013 22:54 GMT
#7620
On October 27 2013 06:09 LaNague wrote:
Show nested quote +
On October 26 2013 19:08 Reggiegigas wrote:
On October 26 2013 05:52 spinesheath wrote:
On October 26 2013 05:40 Reggiegigas wrote:
Hlelo.

studied c++ for a while, wanted to do something on my own. So I'm making a game. and I have a class for characters in the game. And I want to somehow program a way for the program to know about family bonds. like i.e. if a guy's brother has a child, the game should be able to 'get' his new niece object. etc.

it would both affect relationships and various other variables for characters and I'd like to be able to display family free for a certain dynasty (you choose family name when the game starts).

how do I do this? I thought about having some private variables for a character object's siblings, parents, and children, and then somehow telescopically using functions off that to find out grandchildren/cousins/etc.

You seem to be on the right track. Store the bare minimum of information - parents, children, marriage partner, and derive the other family members using functions. These functions can be inside the character class or outside (accessing the publicly readable bare minimum information). Choose which one fits your design best.


Another thing I was thinking about, how to handle characters dying? I had been thinking of moving them to a separate array for all the 'dead' objects. But I suppose that would mean I would have to change a lot of other objects' family relations variables? I'm not sure... Maybe I should just have them all in the same array and not move them anywhere to keep things simple and bug resistant, heh.

Another question: I want to have a private array variable for characters that contain their traits and temporary modifiers, for example a trait that is "bad opinions" towards another character object. So would I have to make this a two-dimensional array? I've never made one of those before but as I understand it, this would allow to make it so each of these trait values would also be able to hold a) a value that points towards which other character object it applies to (if any), then b) a counter thing that counts down with each turn of the game so the trait can be removed when the time reaches zero.


Also, I was considering getting an android tablet to read programming docs on when traveling + possibly coding if there's a decent IDE. Thoughts?




maybe you can make a class "staus effect". You can make a simple array that points to objects of that class and the objects all the stuff like opinion modifiers and target person in them.
You could even maaybe make a general status effect and then derive other classes from it.



Also, i recetnly got the new Nexus 7 and i love it. I just drag drop all the PDFs into google drive and then i can just load them on the Nexus if i need them. So much better than having paper or books with me all the time.


Hm, I checked the nexus but it costs too much for me. :D I ordered a cheap chinese brand tablet. I figured I just need it to read pdf's, how much processing power does that honestly take? As long as the battery time is good and the screen is decent I'm good

On October 27 2013 06:19 killa_robot wrote:
Show nested quote +
On October 26 2013 19:08 Reggiegigas wrote:
On October 26 2013 05:52 spinesheath wrote:
On October 26 2013 05:40 Reggiegigas wrote:
Hlelo.

studied c++ for a while, wanted to do something on my own. So I'm making a game. and I have a class for characters in the game. And I want to somehow program a way for the program to know about family bonds. like i.e. if a guy's brother has a child, the game should be able to 'get' his new niece object. etc.

it would both affect relationships and various other variables for characters and I'd like to be able to display family free for a certain dynasty (you choose family name when the game starts).

how do I do this? I thought about having some private variables for a character object's siblings, parents, and children, and then somehow telescopically using functions off that to find out grandchildren/cousins/etc.

You seem to be on the right track. Store the bare minimum of information - parents, children, marriage partner, and derive the other family members using functions. These functions can be inside the character class or outside (accessing the publicly readable bare minimum information). Choose which one fits your design best.


Another thing I was thinking about, how to handle characters dying? I had been thinking of moving them to a separate array for all the 'dead' objects. But I suppose that would mean I would have to change a lot of other objects' family relations variables? I'm not sure... Maybe I should just have them all in the same array and not move them anywhere to keep things simple and bug resistant, heh.

Another question: I want to have a private array variable for characters that contain their traits and temporary modifiers, for example a trait that is "bad opinions" towards another character object. So would I have to make this a two-dimensional array? I've never made one of those before but as I understand it, this would allow to make it so each of these trait values would also be able to hold a) a value that points towards which other character object it applies to (if any), then b) a counter thing that counts down with each turn of the game so the trait can be removed when the time reaches zero.


Also, I was considering getting an android tablet to read programming docs on when traveling + possibly coding if there's a decent IDE. Thoughts?


For the relatives/relationships, why not create an enum that holds the name/reference to person, and a relationship type, etc. Then just create a list of said enum in the character class (you could even order the list by who has the "closest" relationship to the character).

For dying characters, just have a status flag on them that can be set to dead.


Oh, that does sound really good, but our teacher only mentioned enums in passing so far. I'll try to learn to use enums and then try to understand what you wrote
Prev 1 379 380 381 382 383 1032 Next
Please log in or register to reply.
Live Events Refresh
Korean StarCraft League
03:00
Week 88
CranKy Ducklings131
davetesta35
Liquipedia
The PiG Daily
22:15
Best Games of SC
Rogue vs MaxPax
Maru vs Zoun
SHIN vs Cure
ByuN vs TBD
PiGStarcraft183
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft: Brood War
scan(afreeca) 250
Backho 56
Bale 49
Aegong 24
Pusan 17
Sacsri 12
Icarus 11
Dota 2
NeuroSwarm155
League of Legends
JimRising 712
Counter-Strike
m0e_tv410
Super Smash Bros
hungrybox594
Other Games
summit1g9442
tarik_tv4091
C9.Mang0445
WinterStarcraft403
PiGStarcraft183
Trikslyr160
RuFF_SC2113
Mew2King38
Organizations
Other Games
gamesdonequick993
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 18 non-featured ]
StarCraft 2
• Berry_CruncH292
• HKG_Chickenman57
• practicex 15
• Response 6
• CranKy Ducklings SOOP5
• LaughNgamezSOOP
• sooper7s
• Migwel
• IndyKCrew
• Kozan
• intothetv
• AfreecaTV YouTube
StarCraft: Brood War
• RayReign 32
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Lourlo1034
• Stunt367
Upcoming Events
CranKy Ducklings
5h 15m
WardiTV Map Contest Tou…
6h 15m
SC Evo League
8h 45m
IPSL
11h 15m
WolFix vs nOmaD
dxtr13 vs Razz
BSL
14h 15m
UltrA vs KwarK
Gosudark vs cavapoo
dxtr13 vs HBO
Doodle vs Razz
Patches Events
17h 15m
CranKy Ducklings
19h 15m
Sparkling Tuna Cup
1d 5h
WardiTV Map Contest Tou…
1d 6h
Ladder Legends
1d 10h
[ Show More ]
BSL
1d 14h
StRyKeR vs rasowy
Artosis vs Aether
JDConan vs OyAji
Hawk vs izu
IPSL
1d 14h
JDConan vs TBD
Aegong vs rasowy
Replay Cast
2 days
Wardi Open
2 days
Afreeca Starleague
2 days
Bisu vs Ample
Jaedong vs Flash
Monday Night Weeklies
2 days
RSL Revival
2 days
Afreeca Starleague
3 days
Barracks vs Leta
Royal vs Light
WardiTV Map Contest Tou…
3 days
RSL Revival
4 days
Replay Cast
4 days
The PondCast
5 days
KCM Race Survival
5 days
WardiTV Map Contest Tou…
5 days
Replay Cast
5 days
Escore
6 days
RSL Revival
6 days
Liquipedia Results

Completed

Escore Tournament S2: W3
RSL Revival: Season 4
NationLESS Cup

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
KCM Race Survival 2026 Season 2
StarCraft2 Community Team League 2026 Spring
WardiTV TLMC #16
Nations Cup 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026

Upcoming

Escore Tournament S2: W4
Acropolis #4
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
2026 GSL S2
RSL Revival: Season 5
2026 GSL S1
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.