• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 20:43
CEST 02:43
KST 09:43
  • 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
Serral wins HomeStory Cup 2914Serral wins Maestros of the Game 243ByuL, and the Limitations of Standard Play3Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12
Community News
Balance hotfix patch 5.0.16b (July 16)58Reynor: GSL Loss Wasn't About Preparation Format16[IPSL] Spring 2026 Grand Finals - This Weekend!13Weekly Cups (July 6 - 12): Protoss strike back12BSL Season 22 Full Overview & Conclusion8
StarCraft 2
General
Balance hotfix patch 5.0.16b (July 16) Clem: "I don't have that much hope in Blizzard" [D] Wireframe Casting Removed Reynor: GSL Loss Wasn't About Preparation Format Is the larve respawn broken?
Tourneys
RSL Revival: Season 6 - Qualifiers and Main Event Master Swan Open (Global Bronze-Master 2) WardiTV Summer Cup 2026 GSL CK #5 Race War HomeStory Cup 29
Strategy
[G] Having the right mentality to improve
Custom Maps
New Map Maker - Looking for Advice - Love or Hate Work In Progress Melee Maps [D]RTS in all its shapes and glory <3
External Content
Mutation # 535 Assembly of Vengeance The PondCast: SC2 News & Results Mutation # 534 Burning Evacuation Mutation # 533 Die Together
Brood War
General
NaDa’s Body Followup BW General Discussion ASL22 General Discussion Pros Debate: Zerg Unfairly Nerfed? (ASL S22 map) Etiquete rules in Asl?
Tourneys
[IPSL] Spring 2026 Grand Finals - This Weekend! [Megathread] Daily Proleagues Escore Tournament - Season 3 Small VOD Thread 2.0
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers Creating a full chart of Zerg builds Relatively freeroll strategies
Other Games
General Games
Nintendo Switch Thread Path of Exile Stormgate/Frost Giant Megathread General RTS Discussion Thread Beyond All Reason
Dota 2
Looking for a Dota Mentor Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Power Rank NeO.D_StephenKing vs This Guy From 1 Million Dance TL Mafia Community Thread Vanilla Mini Mafia
Community
General
How to buy a book - shipping from Korea to Europe US Politics Mega-thread Russo-Ukrainian War Thread The Games Industry And ATVI UK Politics Mega-thread
Fan Clubs
The IdrA Fan Club The HerO Fan Club!
Media & Entertainment
Movie Discussion! Anime Discussion Thread [Req][Books] Good Fantasy/SciFi books Series you have seen recently...
Sports
2024 - 2026 Football Thread Formula 1 Discussion MLB/Baseball 2023 McBoner: A hockey love story Tennis[sport]
World Cup 2022
Tech Support
Simple Questions Simple Answers FPS when play League Of Legend on laptop How to clean a TTe Thermaltake keyboard?
TL Community
Northern Ireland Global Starcraft The Automated Ban List
Blogs
Role of Gaming on Mental Hea…
TrAiDoS
ASL S22 English Commentary…
namkraft
Poker (part 2)
Nebuchad
An Exploration of th…
waywardstrategy
ramps on octagon
StaticNine
Funny Nicknames
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 11817 users

The Big Programming Thread - Page 440

Forum Index > General Forum
Post a Reply
Prev 1 438 439 440 441 442 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.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
February 08 2014 22:54 GMT
#8781
@tofu that's one of my favourite posts on SE

alsooo, i just hit 300+ karma in SO

8D
There is no one like you in the universe.
bangsholt
Profile Joined June 2011
Denmark138 Posts
February 08 2014 23:05 GMT
#8782
On February 08 2014 11:30 darkness wrote:
Quick question on C++, is this link a good place to learn C++ basics from? Also, how transferable are my skills from Java and Objective-C for C++? I've used a little bit of basic C, too - stdlib.h (realloc, memset, malloc, free, exit), stdio.h, string.h and math.h.


You seem to be very obsessed with different languages all the time - learn how to program well in one language, once you think that you are capable of that (and if you think you are capable in less than a year - you probably aren't...) then you can move on to the point where you know, what and how to do it. Then it's a question of learning the syntax, because you know the principles of how to do what you want to accomplish.

What language you pick is utterly irrelevant - pick something and stick with it.
meatpudding
Profile Joined March 2011
Australia520 Posts
February 09 2014 00:53 GMT
#8783
On February 09 2014 05:04 one-one-one wrote:
Show nested quote +
On February 09 2014 00:55 BisuDagger wrote:
On February 08 2014 14:16 Rollin wrote:
On February 08 2014 03:45 BisuDagger wrote:
On February 08 2014 02:47 RoyGBiv_13 wrote:
On February 08 2014 02:39 BisuDagger wrote:
Every time I see this thread title I think we should put a project on SVN and give everyone access. Then we can all just jump in and add to the game whenever we have free time. C++ of course (my preference) and built from the ground up. I'd totally put together a frame for a game to jump start this.


Yeah, I'm down. We can collaborate on #tl.code.

I haven't done game dev for some time, but I can help with the lower level modules.


I think I'm going to follow through with this over the next week or two I'll put something together. The simplest style for an open source game is to make it open world. So i'll create a basic open world with directX graphics and setup a camera. From there anyone can literally add whatever the want to it. Physics, graphics, sound, a roaming dragon, anything lol. I'll give updates once I can open this to TL.

Just curious, why no opengl for linux/mac? Do you intend to use OS specific functionality (or keep that option open), hence directx over opengl?

DirectX is way more friendly for newer people imo. I don't want to spend time developing ogl tools.


For a collaborate project like this I would highly recommend that you use open standards and not proprietary stuff like DirectX. If you don't you make the project X86, Windows-only excluding people using Mac or Linux.
Also, if you want to run it on any non-windows platform you will not be able to unless you go for OpenGL.

Projects and products based on open standards are inherently superior to single platform proprietary crap from Microsoft.

The only place where Microsoft is still relevant is the Desktop, but tablets, chromebooks and similar devices will start eating into their 90% market share pretty soon.

I believe that learning OpenGL is a superior choice for young people interested in making games.

You should check out the SteamOS project from valve and try to do something cool with that.




Just to throw in my 2c. DirectX is fine and all, but it still takes a little while to learn, especially for newcomers to c++. MSDN is a great resource and there are heaps of tutorials online. But, mac and linux users will be left out.

When I was developing the updated SC2 map analyser, I started with DirectX graphics, but ended up having to rewrite in opengl due to popular demand. Eventually I switched to using the SDL library, and it's really sweet.

I would definitely reccomend SDL due to it's power, simplicity, licensing and platform support.
Be excellent to each other.
Manit0u
Profile Blog Joined August 2004
Poland17796 Posts
Last Edited: 2014-02-09 01:24:44
February 09 2014 01:22 GMT
#8784
Do you guys know if it's possible to get a hold of AMD's Mantle API? All they ever mention is "look how awesome this is" and all the reviews say that "it's awesome for low-end CPUs" etc. etc. but nowhere can you find a documentation for it or anything that would let you see how hard it is to actually use it, what do they exactly mean by "cross-platform" and how would you implement it in various programming languages...

From what I gather, it's a "step back" when it comes to GPU API, that gets you closer to the hardware and all that jazz.

P. S.

Also, meatpudding might be on the right track here. Some of the games using SDL do look and work amazing (0 a.d., Battle for Wesnoth, Trine).
Time is precious. Waste it wisely.
Zocat
Profile Joined April 2010
Germany2229 Posts
Last Edited: 2014-02-09 01:40:32
February 09 2014 01:39 GMT
#8785
From here: http://support.amd.com/en-us/kb-articles/Pages/mantle-faq.aspx#189

"When does AMD intend to release a public SDK?

We have not set a final date for releasing a public SDK, but we will provide more information later in 2014.​"
one-one-one
Profile Joined November 2011
Sweden551 Posts
February 09 2014 10:56 GMT
#8786
On February 09 2014 09:53 meatpudding wrote:
Show nested quote +
On February 09 2014 05:04 one-one-one wrote:
On February 09 2014 00:55 BisuDagger wrote:
On February 08 2014 14:16 Rollin wrote:
On February 08 2014 03:45 BisuDagger wrote:
On February 08 2014 02:47 RoyGBiv_13 wrote:
On February 08 2014 02:39 BisuDagger wrote:
Every time I see this thread title I think we should put a project on SVN and give everyone access. Then we can all just jump in and add to the game whenever we have free time. C++ of course (my preference) and built from the ground up. I'd totally put together a frame for a game to jump start this.


Yeah, I'm down. We can collaborate on #tl.code.

I haven't done game dev for some time, but I can help with the lower level modules.


I think I'm going to follow through with this over the next week or two I'll put something together. The simplest style for an open source game is to make it open world. So i'll create a basic open world with directX graphics and setup a camera. From there anyone can literally add whatever the want to it. Physics, graphics, sound, a roaming dragon, anything lol. I'll give updates once I can open this to TL.

Just curious, why no opengl for linux/mac? Do you intend to use OS specific functionality (or keep that option open), hence directx over opengl?

DirectX is way more friendly for newer people imo. I don't want to spend time developing ogl tools.


For a collaborate project like this I would highly recommend that you use open standards and not proprietary stuff like DirectX. If you don't you make the project X86, Windows-only excluding people using Mac or Linux.
Also, if you want to run it on any non-windows platform you will not be able to unless you go for OpenGL.

Projects and products based on open standards are inherently superior to single platform proprietary crap from Microsoft.

The only place where Microsoft is still relevant is the Desktop, but tablets, chromebooks and similar devices will start eating into their 90% market share pretty soon.

I believe that learning OpenGL is a superior choice for young people interested in making games.

You should check out the SteamOS project from valve and try to do something cool with that.




Just to throw in my 2c. DirectX is fine and all, but it still takes a little while to learn, especially for newcomers to c++. MSDN is a great resource and there are heaps of tutorials online. But, mac and linux users will be left out.

When I was developing the updated SC2 map analyser, I started with DirectX graphics, but ended up having to rewrite in opengl due to popular demand. Eventually I switched to using the SDL library, and it's really sweet.

I would definitely reccomend SDL due to it's power, simplicity, licensing and platform support.


That is a very good idea.

You also mention the other point, that if you want your software to run on a mac, tablet or smartphone, you need to use OpenGL anyways. I think that it is more likely that this will become a problem than the fact that you are excluding non-windows users in the development process.

http://www.youtube.com/watch?feature=player_embedded&v=1BFY4R7IIP4#t=1710s
Rollin
Profile Joined March 2011
Australia1552 Posts
February 09 2014 11:44 GMT
#8787
Well the issue with going multiplatform and building "from the ground up" is that each platform you want to target is going to need OS specific code, for input handling, audio, etc. In that regard, directx mightn't be a bad idea, or a low level library like allegro/sdl/sfml could be used to avoid the OS specific boilerplate code.
Throw off those chains of reason, and your prison disappears. | Check your posting frequency timeline: http://www.teamliquid.net/mytlnet/post_activity_img.php
one-one-one
Profile Joined November 2011
Sweden551 Posts
February 09 2014 11:56 GMT
#8788
On February 09 2014 20:44 Rollin wrote:
Well the issue with going multiplatform and building "from the ground up" is that each platform you want to target is going to need OS specific code, for input handling, audio, etc. In that regard, directx mightn't be a bad idea, or a low level library like allegro/sdl/sfml could be used to avoid the OS specific boilerplate code.


Well. The guy above specifically mentioned that he had to transition from DirectX to SDL due to popular demand of his program to run on Mac (and Linux?). So there is a success story for you.
SDL is cross platform and will take care of graphics (GL) , input and audio. So no OS specific code is needed for that. You would need different build options for each platform depending on which compiler you use etc.

So what is the point of your post?

http://www.youtube.com/watch?feature=player_embedded&v=1BFY4R7IIP4#t=1710s
Rollin
Profile Joined March 2011
Australia1552 Posts
Last Edited: 2014-02-09 15:16:43
February 09 2014 15:15 GMT
#8789
On February 09 2014 20:56 one-one-one wrote:
Show nested quote +
On February 09 2014 20:44 Rollin wrote:
Well the issue with going multiplatform and building "from the ground up" is that each platform you want to target is going to need OS specific code, for input handling, audio, etc. In that regard, directx mightn't be a bad idea, or a low level library like allegro/sdl/sfml could be used to avoid the OS specific boilerplate code.


Well. The guy above specifically mentioned that he had to transition from DirectX to SDL due to popular demand of his program to run on Mac (and Linux?). So there is a success story for you.
SDL is cross platform and will take care of graphics (GL) , input and audio. So no OS specific code is needed for that. You would need different build options for each platform depending on which compiler you use etc.

So what is the point of your post?


Let's see what BisuDagger said:
+ Show Spoiler +
On February 08 2014 03:45 BisuDagger wrote:
Show nested quote +
On February 08 2014 02:47 RoyGBiv_13 wrote:
On February 08 2014 02:39 BisuDagger wrote:
Every time I see this thread title I think we should put a project on SVN and give everyone access. Then we can all just jump in and add to the game whenever we have free time. C++ of course (my preference) and built from the ground up. I'd totally put together a frame for a game to jump start this.


Yeah, I'm down. We can collaborate on #tl.code.

I haven't done game dev for some time, but I can help with the lower level modules.



I think I'm going to follow through with this over the next week or two I'll put something together. The simplest style for an open source game is to make it open world. So i'll create a basic open world with directX graphics and setup a camera. From there anyone can literally add whatever the want to it. Physics, graphics, sound, a roaming dragon, anything lol. I'll give updates once I can open this to TL.

On February 09 2014 00:55 BisuDagger wrote:
Show nested quote +
On February 08 2014 14:16 Rollin wrote:
On February 08 2014 03:45 BisuDagger wrote:
On February 08 2014 02:47 RoyGBiv_13 wrote:
On February 08 2014 02:39 BisuDagger wrote:
Every time I see this thread title I think we should put a project on SVN and give everyone access. Then we can all just jump in and add to the game whenever we have free time. C++ of course (my preference) and built from the ground up. I'd totally put together a frame for a game to jump start this.


Yeah, I'm down. We can collaborate on #tl.code.

I haven't done game dev for some time, but I can help with the lower level modules.


I think I'm going to follow through with this over the next week or two I'll put something together. The simplest style for an open source game is to make it open world. So i'll create a basic open world with directX graphics and setup a camera. From there anyone can literally add whatever the want to it. Physics, graphics, sound, a roaming dragon, anything lol. I'll give updates once I can open this to TL.

Just curious, why no opengl for linux/mac? Do you intend to use OS specific functionality (or keep that option open), hence directx over opengl?

DirectX is way more friendly for newer people imo. I don't want to spend time developing ogl tools.

On February 09 2014 05:27 BisuDagger wrote:
I hear your points. As a games developer Windows has always been first choice as a the platform for development. I understand Linux has become far more popular over the past few years and if the belief is I'll be isolating a lot of interested developers on teamliquid then I will have no choice but to use OGL. So I will go ahead and setup ogl instead of being stubborn.


There is no mention of any library used other than raw opengl, bisudagger says he wants to do it "from the ground up", and roygbiv says he's willing to help out with "low level stuff". None of this hints at wanting to use a slightly more abstracted library like sdl, even with raw opengl underneath.

So what is the point of your post?
Throw off those chains of reason, and your prison disappears. | Check your posting frequency timeline: http://www.teamliquid.net/mytlnet/post_activity_img.php
one-one-one
Profile Joined November 2011
Sweden551 Posts
February 09 2014 15:29 GMT
#8790
On February 10 2014 00:15 Rollin wrote:
Show nested quote +
On February 09 2014 20:56 one-one-one wrote:
On February 09 2014 20:44 Rollin wrote:
Well the issue with going multiplatform and building "from the ground up" is that each platform you want to target is going to need OS specific code, for input handling, audio, etc. In that regard, directx mightn't be a bad idea, or a low level library like allegro/sdl/sfml could be used to avoid the OS specific boilerplate code.


Well. The guy above specifically mentioned that he had to transition from DirectX to SDL due to popular demand of his program to run on Mac (and Linux?). So there is a success story for you.
SDL is cross platform and will take care of graphics (GL) , input and audio. So no OS specific code is needed for that. You would need different build options for each platform depending on which compiler you use etc.

So what is the point of your post?


Let's see what BisuDagger said:
+ Show Spoiler +
On February 08 2014 03:45 BisuDagger wrote:
Show nested quote +
On February 08 2014 02:47 RoyGBiv_13 wrote:
On February 08 2014 02:39 BisuDagger wrote:
Every time I see this thread title I think we should put a project on SVN and give everyone access. Then we can all just jump in and add to the game whenever we have free time. C++ of course (my preference) and built from the ground up. I'd totally put together a frame for a game to jump start this.


Yeah, I'm down. We can collaborate on #tl.code.

I haven't done game dev for some time, but I can help with the lower level modules.



I think I'm going to follow through with this over the next week or two I'll put something together. The simplest style for an open source game is to make it open world. So i'll create a basic open world with directX graphics and setup a camera. From there anyone can literally add whatever the want to it. Physics, graphics, sound, a roaming dragon, anything lol. I'll give updates once I can open this to TL.

On February 09 2014 00:55 BisuDagger wrote:
Show nested quote +
On February 08 2014 14:16 Rollin wrote:
On February 08 2014 03:45 BisuDagger wrote:
On February 08 2014 02:47 RoyGBiv_13 wrote:
On February 08 2014 02:39 BisuDagger wrote:
Every time I see this thread title I think we should put a project on SVN and give everyone access. Then we can all just jump in and add to the game whenever we have free time. C++ of course (my preference) and built from the ground up. I'd totally put together a frame for a game to jump start this.


Yeah, I'm down. We can collaborate on #tl.code.

I haven't done game dev for some time, but I can help with the lower level modules.


I think I'm going to follow through with this over the next week or two I'll put something together. The simplest style for an open source game is to make it open world. So i'll create a basic open world with directX graphics and setup a camera. From there anyone can literally add whatever the want to it. Physics, graphics, sound, a roaming dragon, anything lol. I'll give updates once I can open this to TL.

Just curious, why no opengl for linux/mac? Do you intend to use OS specific functionality (or keep that option open), hence directx over opengl?

DirectX is way more friendly for newer people imo. I don't want to spend time developing ogl tools.

On February 09 2014 05:27 BisuDagger wrote:
I hear your points. As a games developer Windows has always been first choice as a the platform for development. I understand Linux has become far more popular over the past few years and if the belief is I'll be isolating a lot of interested developers on teamliquid then I will have no choice but to use OGL. So I will go ahead and setup ogl instead of being stubborn.


There is no mention of any library used other than raw opengl, bisudagger says he wants to do it "from the ground up", and roygbiv says he's willing to help out with "low level stuff". None of this hints at wanting to use a slightly more abstracted library like sdl, even with raw opengl underneath.

So what is the point of your post?


Are you drunk?

You asked them yourself about the whole DirectX vs OpenGL thing. It is even included in the nested quotes above.

Ok, I get that it is probably in the middle of the night in Australia, but programming should not be discussed under the influence of alcohol.
http://www.youtube.com/watch?feature=player_embedded&v=1BFY4R7IIP4#t=1710s
Uberrated
Profile Joined September 2010
Norway9 Posts
February 09 2014 17:43 GMT
#8791
You guys should consider Libgdx. It's java, but runs on all platforms (even HTML5), and solves all problems with input abstractions ect. It comes bundled with a sick implementation of Box2d for added awesome.
Rollin
Profile Joined March 2011
Australia1552 Posts
February 09 2014 19:41 GMT
#8792
On February 10 2014 00:29 one-one-one wrote:
Show nested quote +
On February 10 2014 00:15 Rollin wrote:
On February 09 2014 20:56 one-one-one wrote:
On February 09 2014 20:44 Rollin wrote:
Well the issue with going multiplatform and building "from the ground up" is that each platform you want to target is going to need OS specific code, for input handling, audio, etc. In that regard, directx mightn't be a bad idea, or a low level library like allegro/sdl/sfml could be used to avoid the OS specific boilerplate code.


Well. The guy above specifically mentioned that he had to transition from DirectX to SDL due to popular demand of his program to run on Mac (and Linux?). So there is a success story for you.
SDL is cross platform and will take care of graphics (GL) , input and audio. So no OS specific code is needed for that. You would need different build options for each platform depending on which compiler you use etc.

So what is the point of your post?


Let's see what BisuDagger said:
+ Show Spoiler +
On February 08 2014 03:45 BisuDagger wrote:
Show nested quote +
On February 08 2014 02:47 RoyGBiv_13 wrote:
On February 08 2014 02:39 BisuDagger wrote:
Every time I see this thread title I think we should put a project on SVN and give everyone access. Then we can all just jump in and add to the game whenever we have free time. C++ of course (my preference) and built from the ground up. I'd totally put together a frame for a game to jump start this.


Yeah, I'm down. We can collaborate on #tl.code.

I haven't done game dev for some time, but I can help with the lower level modules.



I think I'm going to follow through with this over the next week or two I'll put something together. The simplest style for an open source game is to make it open world. So i'll create a basic open world with directX graphics and setup a camera. From there anyone can literally add whatever the want to it. Physics, graphics, sound, a roaming dragon, anything lol. I'll give updates once I can open this to TL.

On February 09 2014 00:55 BisuDagger wrote:
Show nested quote +
On February 08 2014 14:16 Rollin wrote:
On February 08 2014 03:45 BisuDagger wrote:
On February 08 2014 02:47 RoyGBiv_13 wrote:
On February 08 2014 02:39 BisuDagger wrote:
Every time I see this thread title I think we should put a project on SVN and give everyone access. Then we can all just jump in and add to the game whenever we have free time. C++ of course (my preference) and built from the ground up. I'd totally put together a frame for a game to jump start this.


Yeah, I'm down. We can collaborate on #tl.code.

I haven't done game dev for some time, but I can help with the lower level modules.


I think I'm going to follow through with this over the next week or two I'll put something together. The simplest style for an open source game is to make it open world. So i'll create a basic open world with directX graphics and setup a camera. From there anyone can literally add whatever the want to it. Physics, graphics, sound, a roaming dragon, anything lol. I'll give updates once I can open this to TL.

Just curious, why no opengl for linux/mac? Do you intend to use OS specific functionality (or keep that option open), hence directx over opengl?

DirectX is way more friendly for newer people imo. I don't want to spend time developing ogl tools.

On February 09 2014 05:27 BisuDagger wrote:
I hear your points. As a games developer Windows has always been first choice as a the platform for development. I understand Linux has become far more popular over the past few years and if the belief is I'll be isolating a lot of interested developers on teamliquid then I will have no choice but to use OGL. So I will go ahead and setup ogl instead of being stubborn.


There is no mention of any library used other than raw opengl, bisudagger says he wants to do it "from the ground up", and roygbiv says he's willing to help out with "low level stuff". None of this hints at wanting to use a slightly more abstracted library like sdl, even with raw opengl underneath.

So what is the point of your post?


Are you drunk?

You asked them yourself about the whole DirectX vs OpenGL thing. It is even included in the nested quotes above.

Ok, I get that it is probably in the middle of the night in Australia, but programming should not be discussed under the influence of alcohol.

Thanks for the pointless insults. You still haven't shown me any evidence that an opengl wrapping library was to be used at all. Or maybe you have and I just lack the basic intelligence required to decipher your seemingly nonsensical replies?
Throw off those chains of reason, and your prison disappears. | Check your posting frequency timeline: http://www.teamliquid.net/mytlnet/post_activity_img.php
tofucake
Profile Blog Joined October 2009
Hyrule19228 Posts
February 09 2014 20:35 GMT
#8793
keep it civil, people
Liquipediaasante sana squash banana
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2014-02-10 00:56:33
February 10 2014 00:55 GMT
#8794
How do you guys make a deep copy of an object in Java? I've done a bit of Google, and I've learnt that object.clone() is bad unless you just clone a primitive data type (Effective Java book as an argument). I've read about 2 other solutions - copy constructor and serialisation. Which one do you prefer and why? I feel like the copy constructor approach has so much code duplication (well, attributes are redefined) if I've understood the knack of it.
sluggaslamoo
Profile Blog Joined November 2009
Australia4494 Posts
Last Edited: 2014-02-10 02:51:44
February 10 2014 02:42 GMT
#8795
On February 10 2014 04:41 Rollin wrote:
Show nested quote +
On February 10 2014 00:29 one-one-one wrote:
On February 10 2014 00:15 Rollin wrote:
On February 09 2014 20:56 one-one-one wrote:
On February 09 2014 20:44 Rollin wrote:
Well the issue with going multiplatform and building "from the ground up" is that each platform you want to target is going to need OS specific code, for input handling, audio, etc. In that regard, directx mightn't be a bad idea, or a low level library like allegro/sdl/sfml could be used to avoid the OS specific boilerplate code.


Well. The guy above specifically mentioned that he had to transition from DirectX to SDL due to popular demand of his program to run on Mac (and Linux?). So there is a success story for you.
SDL is cross platform and will take care of graphics (GL) , input and audio. So no OS specific code is needed for that. You would need different build options for each platform depending on which compiler you use etc.

So what is the point of your post?


Let's see what BisuDagger said:
+ Show Spoiler +
On February 08 2014 03:45 BisuDagger wrote:
Show nested quote +
On February 08 2014 02:47 RoyGBiv_13 wrote:
On February 08 2014 02:39 BisuDagger wrote:
Every time I see this thread title I think we should put a project on SVN and give everyone access. Then we can all just jump in and add to the game whenever we have free time. C++ of course (my preference) and built from the ground up. I'd totally put together a frame for a game to jump start this.


Yeah, I'm down. We can collaborate on #tl.code.

I haven't done game dev for some time, but I can help with the lower level modules.



I think I'm going to follow through with this over the next week or two I'll put something together. The simplest style for an open source game is to make it open world. So i'll create a basic open world with directX graphics and setup a camera. From there anyone can literally add whatever the want to it. Physics, graphics, sound, a roaming dragon, anything lol. I'll give updates once I can open this to TL.

On February 09 2014 00:55 BisuDagger wrote:
Show nested quote +
On February 08 2014 14:16 Rollin wrote:
On February 08 2014 03:45 BisuDagger wrote:
On February 08 2014 02:47 RoyGBiv_13 wrote:
On February 08 2014 02:39 BisuDagger wrote:
Every time I see this thread title I think we should put a project on SVN and give everyone access. Then we can all just jump in and add to the game whenever we have free time. C++ of course (my preference) and built from the ground up. I'd totally put together a frame for a game to jump start this.


Yeah, I'm down. We can collaborate on #tl.code.

I haven't done game dev for some time, but I can help with the lower level modules.


I think I'm going to follow through with this over the next week or two I'll put something together. The simplest style for an open source game is to make it open world. So i'll create a basic open world with directX graphics and setup a camera. From there anyone can literally add whatever the want to it. Physics, graphics, sound, a roaming dragon, anything lol. I'll give updates once I can open this to TL.

Just curious, why no opengl for linux/mac? Do you intend to use OS specific functionality (or keep that option open), hence directx over opengl?

DirectX is way more friendly for newer people imo. I don't want to spend time developing ogl tools.

On February 09 2014 05:27 BisuDagger wrote:
I hear your points. As a games developer Windows has always been first choice as a the platform for development. I understand Linux has become far more popular over the past few years and if the belief is I'll be isolating a lot of interested developers on teamliquid then I will have no choice but to use OGL. So I will go ahead and setup ogl instead of being stubborn.


There is no mention of any library used other than raw opengl, bisudagger says he wants to do it "from the ground up", and roygbiv says he's willing to help out with "low level stuff". None of this hints at wanting to use a slightly more abstracted library like sdl, even with raw opengl underneath.

So what is the point of your post?


Are you drunk?

You asked them yourself about the whole DirectX vs OpenGL thing. It is even included in the nested quotes above.

Ok, I get that it is probably in the middle of the night in Australia, but programming should not be discussed under the influence of alcohol.

Thanks for the pointless insults. You still haven't shown me any evidence that an opengl wrapping library was to be used at all. Or maybe you have and I just lack the basic intelligence required to decipher your seemingly nonsensical replies?


I think this is assumed. Regardless its not that hard to do everything from scratch when it concerns OpenGL or DirectX, I prefer to do "raw" OpenGL for 2.5D projects but even 3D is not that big of a deal.

The main reason I don't do raw OpenGL for 3d projects is not so much the code but the authoring tools, like scene editors, which allow me to view 3d models and know exactly how they will appear in game. There's no point reinventing the wheel for tools such as these.

If boilerplate is an issue then DirectX is a bad idea, DirectX has a TON of boilerplate and setup. OpenGL is much much simpler to get started on. OS specific boilerplate really isn't a major concern, and many simple 3D libraries do not really help with this, such as SDL or SFML.

Also are you saying that DirectX is better because we do not have to address OS specific boilerplate (because it only supports Windows)? If so it seems like a really strange solution, you could do the same thing with OpenGL by only supporting Windows. Regardless you will always have significantly less boilerplate in OpenGL except for very large projects (and I'm talking AAA title projects here).

This is because you don't have to do anything to get cross-platformability with OpenGL except for very advanced features. Graphics cards are a much greater problem when it comes to this, not OS's.

Although I'm going to go out on a limb here and say that this project will barely get off the ground. Focusing on such issues is very immature when you don't even know what it is you are actually making, MVP is the most important thing right now.
Come play Android Netrunner - http://www.teamliquid.net/forum/viewmessage.php?topic_id=409008
PaiNt)
Profile Joined June 2009
United States38 Posts
February 10 2014 03:59 GMT
#8796
Hey guys, not sure if this is something I should be posting here... but oh well . I recently released my first game for Android and it would be cool if tried it out. It's one of the many geometry wars clones out there, but I figured it was a simple game that would be a good starting point for me. I'm still making some improvements, but the core game play is all there. If you have any feedback I'm definitely open to it.

https://play.google.com/store/apps/details?id=com.hsoft.spaceshapes
dapierow
Profile Blog Joined April 2010
Serbia1316 Posts
February 10 2014 06:18 GMT
#8797
Hey guys, been trying to pop a card(class) off my stack(deck) in a java class for the past hour but it will always return the top card, even after Ive popped it off, can anyone help out?


public class Card
{
public static final int JACK = 11;
public static final int QUEEN = 12;
public static final int KING = 13;
public static final int ACE = 14;

public static final int DIAMONDS = 0;
public static final int HEARTS = 1;
public static final int SPADES = 2;
public static final int CLUBS = 3;

public static final int[] SUITSOFCARDS= {DIAMONDS, HEARTS, SPADES ,CLUBS};

public static final int MIN_CARD_VALUE = 2;
public static final int MAX_CARD_VALUE = 14;

public static int value;
public static int suit;

public Card(int valueofCard, int suitofCard)
{
this.value = valueofCard;
this.suit = suitofCard;
}

public int getValueOfCard() { return value; }
public int getSuitOfCard() { return suit; }

private String valueToString()
{
String val= "";

if( value >= MIN_CARD_VALUE && value < JACK )
val += value;
else
{
switch(value)
{
case JACK: val = "Jack"; break;
case QUEEN: val = "Queen"; break;
case KING: val = "King"; break;
case ACE: val = "Ace"; break;
}

}

return val;
}

private String suitToString()
{
String su = "";

switch(suit)
{
case DIAMONDS: su = "Diamonds"; break;
case HEARTS: su = "Hearts"; break;
case CLUBS: su = "Clubs"; break;
case SPADES: su = "Spades"; break;
}

return su;
}

public boolean equals(Card compareToObj )
{
return (value == compareToObj.value ) && ( suit == compareToObj.suit );
}

public String toString()
{
return valueToString() + " of " + suitToString();
}


}



import java.util.*;

public class Deck
{
public Stack<Card> deck;

public Deck()
{
setUpDeck();
}

public void setUpDeck()
{
deck = new Stack<Card>();
for(int suit = 0; suit < Card.SUITSOFCARDS.length; suit++)
{
for(int value=Card.MIN_CARD_VALUE; value <= Card.MAX_CARD_VALUE; value++)
{
Card card = new Card(value, Card.SUITSOFCARDS[suit]);
deck.push(card);
System.out.println("Top Card is: "+deck.peek());
}
}

}

public boolean isEmpty()
{
return deck.isEmpty();
}

public int size()
{
return deck.size();
}

public Card drawCard()
{
return deck.pop();
}

public Card showTopCard()
{
return deck.peek();
}
}




public class Main
{
public static void main(String args[])
{
Main program = new Main();
program.run();

}

public void run()
{
Deck gameDeck = new Deck();

System.out.println("Deck has: " + gameDeck.size() + " Cards");

int count = 0;
while(gameDeck.size()>0)
{
Card card = gameDeck.drawCard();
System.out.println(String.format("[Card %2d]: Drew the %s card.", (++count), card.toString()));

}

System.out.println("Deck is empty.");

}
}



The output works in the setUpDeck class, but in the main, it always returns ACE of CLUBS...
Eat.Sleep.Starcraft 2
Creepseep
Profile Joined July 2012
Germany9 Posts
February 10 2014 06:46 GMT
#8798
On February 10 2014 15:18 dapierow wrote:
Hey guys, been trying to pop a card(class) off my stack(deck) in a java class for the past hour but it will always return the top card, even after Ive popped it off, can anyone help out?

...

The output works in the setUpDeck class, but in the main, it always returns ACE of CLUBS...


Just looked over it for a sec, maybe I'm wrong, but your class variables value and suit should'nt be static in this case.
dapierow
Profile Blog Joined April 2010
Serbia1316 Posts
February 10 2014 06:56 GMT
#8799
On February 10 2014 15:46 Creepseep wrote:
Show nested quote +
On February 10 2014 15:18 dapierow wrote:
Hey guys, been trying to pop a card(class) off my stack(deck) in a java class for the past hour but it will always return the top card, even after Ive popped it off, can anyone help out?

...

The output works in the setUpDeck class, but in the main, it always returns ACE of CLUBS...


Just looked over it for a sec, maybe I'm wrong, but your class variables value and suit should'nt be static in this case.


2 hours of headache... because of that shit... are you fucking kidding me...
that'll teach me to write more than one class without testing it...

Thanks a bunch, ima go cry now for all that wasted time.
Eat.Sleep.Starcraft 2
Tobberoth
Profile Joined August 2010
Sweden6375 Posts
February 10 2014 07:59 GMT
#8800
On February 10 2014 09:55 darkness wrote:
How do you guys make a deep copy of an object in Java? I've done a bit of Google, and I've learnt that object.clone() is bad unless you just clone a primitive data type (Effective Java book as an argument). I've read about 2 other solutions - copy constructor and serialisation. Which one do you prefer and why? I feel like the copy constructor approach has so much code duplication (well, attributes are redefined) if I've understood the knack of it.

This is mostly an assumption on my end, but I would assume that serialization is slower and uses more resources, but requires far less code to do and is more generic. It's quite a lot of work to write a copy constructor for each object you need to deep copy, but then again, it's just basic object initialization where as serialization requires a bit more intermediate steps.

Then again, I could be wrong and serialization might be very optimized in Java.

I would go with the serialization approach unless it's really simple objects.
Prev 1 438 439 440 441 442 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 10h 17m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SpeCial 165
Tasteless 8
StarCraft: Brood War
GuemChi 3910
Artosis 722
Purpose 12
Dota 2
NeuroSwarm209
Counter-Strike
minikerr116
Super Smash Bros
hungrybox1089
Mew2King1017
C9.Mang0885
Heroes of the Storm
Khaldor187
Other Games
ToD296
Maynarde142
XaKoH 86
Organizations
Other Games
gamesdonequick2311
BasetradeTV296
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 16 non-featured ]
StarCraft 2
• Hupsaiya 112
• EnkiAlexander 47
• davetesta38
• RyuSc2 31
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• masondota21516
Other Games
• Shiphtur664
Upcoming Events
WardiTV Weekly
10h 17m
Monday Night Weeklies
15h 17m
OSC
23h 17m
PiGosaur Cup
1d 23h
The PondCast
2 days
Kung Fu Cup
2 days
CrankTV Team League
3 days
Replay Cast
3 days
CrankTV Team League
4 days
Korean StarCraft League
5 days
[ Show More ]
RSL Revival
5 days
Online Event
5 days
Replay Cast
5 days
RSL Revival
6 days
Liquipedia Results

Completed

IPSL Spring 2026
HSC XXIX
Eternal Conflict S2 E2

Ongoing

Acropolis #4
CSL 2026 Summer (S21)
KCM Race Survival 2026 Season 3
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
SCTL 2026 Spring
Eternal Conflict S2 E3
Stake Ranked Episode 3
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

Upcoming

Escore Tournament S3: W4
ASL S22 SEASON OPEN Day 2
Escore Tournament S3: W5
CSLAN 4
Blizzard Classic Cup 2026
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
Light Tournament 2026
Eternal Conflict S2 Finale
Stake Ranked Episode 4
Logitech G Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #5
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
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.