• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 10:12
CET 16:12
KST 00:12
  • 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
RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15[BSL21] Ro.16 Group Stage (C->B->A->D)4Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win3RSL Season 3: RO16 results & RO8 bracket13
StarCraft 2
General
Chinese SC2 server to reopen; live all-star event in Hangzhou Maestros of the Game: Live Finals Preview (RO4) BGE Stara Zagora 2026 announced Weekly Cups (Nov 24-30): MaxPax, Clem, herO win SC2 Proleague Discontinued; SKT, KT, SGK, CJ disband
Tourneys
$5,000+ WardiTV 2025 Championship Constellation Cup - Main Event - Stellar Fest RSL Revival: Season 3 Tenacious Turtle Tussle [Alpha Pro Series] Nice vs Cure
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress Mutation # 500 Fright night Mutation # 499 Chilling Adaptation
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ Data analysis on 70 million replays Which season is the best in ASL? [ASL20] Ask the mapmakers — Drop your questions BW General Discussion
Tourneys
[Megathread] Daily Proleagues [BSL21] RO16 Group B - Sunday 21:00 CET [BSL21] RO16 Group C - Saturday 21:00 CET Small VOD Thread 2.0
Strategy
Game Theory for Starcraft How to stay on top of macro? Current Meta PvZ map balance
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread The Perfect Game Path of Exile Should offensive tower rushing be viable in RTS games?
Dota 2
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 Heroes of StarCraft mini-set
TL Mafia
Mafia Game Mode Feedback/Ideas TL Mafia Community Thread
Community
General
Things Aren’t Peaceful in Palestine US Politics Mega-thread Russo-Ukrainian War Thread The Big Programming Thread Artificial Intelligence Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Where to ask questions and add stream? The Automated Ban List
Blogs
James Bond movies ranking - pa…
Topin
Esports Earnings: Bigger Pri…
TrAiDoS
Thanks for the RSL
Hildegard
Saturation point
Uldridge
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1288 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
Poland17493 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
Hyrule19167 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
Wardi Open
12:00
Qualifier #4
WardiTV1075
TKL 226
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Fuzer 254
TKL 226
ProTech140
LamboSC2 26
StarCraft: Brood War
Calm 5821
Shuttle 2255
Horang2 2021
Jaedong 1334
actioN 687
Mini 687
EffOrt 441
ZerO 391
Light 355
Snow 197
[ Show more ]
Rush 170
Hyun 151
Mong 103
Sharp 64
hero 61
yabsab 40
ToSsGirL 32
Aegong 31
soO 31
JYJ28
sorry 27
Terrorterran 20
Rock 17
scan(afreeca) 16
Dota 2
Gorgc4496
qojqva2856
singsing2776
Dendi682
syndereN273
boxi98177
Counter-Strike
x6flipin689
oskar109
Other Games
B2W.Neo1235
hiko807
Hui .342
QueenE78
nookyyy 41
Liquid`VortiX21
ZerO(Twitch)10
Organizations
StarCraft: Brood War
Kim Chul Min (afreeca) 7
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• StrangeGG 79
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 3254
• WagamamaTV371
League of Legends
• TFBlade874
Upcoming Events
StarCraft2.fi
1h 48m
Replay Cast
8h 48m
The PondCast
18h 48m
OSC
1d
Demi vs Mixu
Nicoract vs TBD
Babymarine vs MindelVK
ForJumy vs TBD
Shameless vs Percival
Replay Cast
1d 8h
Korean StarCraft League
2 days
CranKy Ducklings
2 days
WardiTV 2025
2 days
SC Evo League
2 days
BSL 21
3 days
Sziky vs OyAji
Gypsy vs eOnzErG
[ Show More ]
OSC
3 days
Solar vs Creator
ByuN vs Gerald
Percival vs Babymarine
Moja vs Krystianer
EnDerr vs ForJumy
sebesdes vs Nicoract
Sparkling Tuna Cup
3 days
WardiTV 2025
3 days
OSC
3 days
BSL 21
4 days
Bonyth vs StRyKeR
Tarson vs Dandy
Replay Cast
4 days
Wardi Open
4 days
StarCraft2.fi
5 days
Monday Night Weeklies
5 days
Replay Cast
5 days
WardiTV 2025
5 days
StarCraft2.fi
6 days
PiGosaur Monday
6 days
Liquipedia Results

Completed

Proleague 2025-11-30
RSL Revival: Season 3
Light HT

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
CSCL: Masked Kings S3
Slon Tour Season 2
Acropolis #4 - TS3
META Madness #9
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
Kuram Kup
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
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 © 2025 TLnet. All Rights Reserved.