Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 353 354 [355] 356 357 ... 796

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 886527 times)

Another

  • Bay Watcher
    • View Profile
Re: if(self.isCoder()){post(&Programming_Thread);}
« Reply #5310 on: December 25, 2013, 07:46:42 am »

I would actually recommend starting learning programming languages with Python* because it places a slightly higher accent on general programming techniques than on low-level stuff.

But of all C-like languages (C, C++, C#, Java, ...) C++ has the most broad scope of applications (not tied in to Microsoft or dependant on running virtual machine) and learning it from http://www.cplusplus.com/doc/tutorial/ would be not that difficult. Most language tutorial stuff is about 85% applicable to other programming languages. Extensive language reference on that site is invariably accompanied with very nice short examples of usage.

A general non language-specific programming theory course/book is also recommended because no matter how well you know some language - without some theoretic perspective it is much less useful.

*But mandatory tab formatting just appals me even though I usually end doing similar formatting in my non-Python code.
Logged

miauw62

  • Bay Watcher
  • Every time you get ahead / it's just another hit
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5311 on: December 25, 2013, 12:13:24 pm »

Not even tab formatting. Four spaces
* miauw62 shudders.
Logged

Quote from: NW_Kohaku
they wouldn't be able to tell the difference between the raving confessions of a mass murdering cannibal from a recipe to bake a pie.
Knowing Belgium, everyone will vote for themselves out of mistrust for anyone else, and some kind of weird direct democracy coalition will need to be formed from 11 million or so individuals.

Just Some Guy

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5312 on: January 06, 2014, 06:29:25 pm »

Screw it, can anyone recommend a good isometric java-based game engine for Dwarf Fortress/Pharaoh like games? It tried to make one on my own, but I quickly found out that I lacked the skill to do so.

It's for a personal project with an admittedly very small chance of becoming something bigger.

I'm aiming for a retro-esque look. Here's a picture if it helps:

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5313 on: January 06, 2014, 07:02:55 pm »

Screw it, can anyone recommend a good isometric java-based game engine for Dwarf Fortress/Pharaoh like games? It tried to make one on my own, but I quickly found out that I lacked the skill to do so.

It's for a personal project with an admittedly very small chance of becoming something bigger.

I'm aiming for a retro-esque look. Here's a picture if it helps:


There is no such thing as a game engine for city-building games, much less isometric city-building games. If you want a city-building game, you'll have to write your own engine for that. I don't even know if there is such a thing as an engine specifically for isometric games (I would think not), because even isometric games generally need the full feature set of any game engine. I can definitely recommend LWJGL for your programming endeavours, though. Grab yourself LWJGL, read lots of tutorials, and try getting as far as you can, and if you have any questions, I'll be glad to help you.
Logged

Just Some Guy

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5314 on: January 06, 2014, 07:58:59 pm »

So, where should I extract it to?

This isn't compatible with jGrasp, isn't it?

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5315 on: January 06, 2014, 07:59:38 pm »

I can't speak for Java as I know next to nothing about it, but I'm pretty sure when I was looking around for this before I found a few in other languages (C++ and I think Python?).  They were commercially licensed though I believe.

Don't feel bad about running into trouble with coding an isometric game though.  I spent a while writing one and it turned out to have a astonishing number of deep complexities I didn't anticipate.  I had no idea that I'd need to use matrix transformations to convert mouse clicks into worldspace coordinates for example.  I got as far as pathfinding and dropped the project for now due to a lot of real life stuff taking up my time.

Grabbing something that will abstract away rendering sprites and handling input and sound will go a long way toward what you need to really get started though.



Completely unrelated to the above, but I'm increasingly of the opinion that it should be a criminal offense to write new code in Fortran.  That language needs to go away, now.  Can anyone guess what it takes to make the following code:

Code: [Select]
print *, omp_get_num_threads()

print out the number 0.92?  As in, claiming that my program is running on 0.92 threads inside that block of code?

Oh, I just forgot this line:

Code: [Select]
use omp_lib

A warning that it didn't know what the interface for omp_get_num_threads was supposed to be would have been nice.  Instead I spend 2 hours trying to figure that out and why it also claimed that the maximum number of threads was either 0 or 0.5.

I've never actually taken advantage of it, but I seem to recall that C assumes an integer return type if none is provided.  I guess Fortran assumes a floating point of some type.

I'm seriously questioning the wisdom of allowing no specification of the return type.  Especially without a warning.
Logged
Through pain, I find wisdom.

Just Some Guy

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5316 on: January 06, 2014, 08:51:00 pm »

People still use Fortran?

Anyway, I can't seem to download LWJGL. It says the .zip file isn't compatible. Help?

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5317 on: January 06, 2014, 08:57:00 pm »

Anyway, I can't seem to download LWJGL. It says the .zip file isn't compatible. Help?
Works for me though. Try redownloading the zip file, wait until it finishes. If you still can't open it, get a better zip extractor. If you still can't open it, you're downloading the wrong thing.
Logged

Just Some Guy

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5318 on: January 06, 2014, 09:39:06 pm »

Finally found a version that works!

Where do I put it?

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5319 on: January 06, 2014, 10:03:59 pm »

Finally found a version that works!

Where do I put it?
I'll assume you're using eclipse, right? Unzip the zip to a place it can stay forever. Then make a new project. Right-click the project -> Build path -> Add external archive, select the lwjgl.jar from the zip. Then look at your project in the left sidebar, right-click lwjgl.jar -> Properties -> Native Library, press the "External Folder" button, and select the natives/YOUR_OS folder from the zip. Then you should be done. You can add a source and javadoc too, just do the same steps as with the native library.

If you aren't using Eclipse and are compiling manually using javac and java, you don't need those steps. Instead of these commands:
Code: [Select]
javac YourMainClass.java
java YourMainClass
Just use these:
Code: [Select]
javac -classpath ".;path/to/jar/lwjgl.jar" -Djava.library.path="path/to/native/YOUR_OS" YourMainClass.java
java -classpath ".;path/to/jar/lwjgl.jar" -Djava.library.path="path/to/native/YOUR_OS" YourMainClass
If you're using Linux or MacOS, you'll probably want to use colons instead of semicolons.
Logged

Just Some Guy

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5320 on: January 06, 2014, 11:31:32 pm »

I'm using jGrasp.

I apoligize for any frustration I'm causing you right now. Do I still have to do the commands?

olemars

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5321 on: January 07, 2014, 04:32:33 am »

Completely unrelated to the above, but I'm increasingly of the opinion that it should be a criminal offense to write new code in Fortran.  That language needs to go away, now.  Can anyone guess what it takes to make the following code:

Code: [Select]
print *, omp_get_num_threads()

print out the number 0.92?  As in, claiming that my program is running on 0.92 threads inside that block of code?

Oh, I just forgot this line:

Code: [Select]
use omp_lib

A warning that it didn't know what the interface for omp_get_num_threads was supposed to be would have been nice.  Instead I spend 2 hours trying to figure that out and why it also claimed that the maximum number of threads was either 0 or 0.5.

I've never actually taken advantage of it, but I seem to recall that C assumes an integer return type if none is provided.  I guess Fortran assumes a floating point of some type.

I'm seriously questioning the wisdom of allowing no specification of the return type.  Especially without a warning.

If you have enough IMPLICIT NONE in your code there should be compile errors, otherwise it will assume real type of anything referenced.

I have actually experienced something vaguely similar in C++, due to compiler differences. It's undefined behaviour what a function returns if it has a non-void return type but no return statement in the body. MSVC will throw a compiler error (except in the cases where only some branches of the body have no return), while gcc will happily compile (there might be a warning) and just return some garbage value when the function is called.
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #5322 on: January 07, 2014, 04:34:49 am »

Dangit, my use of Python and Perl the past week has spoiled me D:

It's sooooooo convenient and easy to work with...
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5323 on: January 07, 2014, 06:58:38 am »

I'm using jGrasp.
So I installed jGrasp, and here's what you have to do to make your project use LWJGL: Make a new project. Go to Settings -> Compiler Settings -> PATH -> CLASSPATHS -> New -> Jar File -> Browse, look for and select lwjgl.jar.
Then in the same window, go to Compiler -> Java -> Flags/Args/Main, and in the left column for "Run" and "Debug", insert -Djava.library.path=<PATH>, where <PATH> needs to be the path to your OS's native folder for LWJGL.
That should be all.
Logged

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #5324 on: January 07, 2014, 07:47:14 am »

Screw it, can anyone recommend a good isometric java-based game engine for Dwarf Fortress/Pharaoh like games? It tried to make one on my own, but I quickly found out that I lacked the skill to do so.
I started with something like that once, here's the source, dunno if it's useable though. I lost interest when I couldn't get the mp3 playback to work in a browser, and then I grew to hate Java.
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))
Pages: 1 ... 353 354 [355] 356 357 ... 796