Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 645 646 [647] 648 649 ... 796

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

Avis-Mergulus

  • Bay Watcher
  • This adorable animal can't work.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9690 on: June 06, 2016, 11:09:52 am »

Idle question: supposing one wished to do hobby game development in one's spare time, what language would one do that in?
Logged
“See this Payam!” cried the gods, “He deceives us! He cruelly abuses our lustful hearts!”

Shadowlord

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9691 on: June 06, 2016, 11:35:51 am »

Depends what you want to do, and what you already know, and what you're willing to learn.

For instance:
  • Unity is popular, uses C#, but is somewhat complicated (although it's actually not too hard to learn, and has decent documentation) - it also only requires paying for Unity Pro if you actually make a fair amount of money with it.
  • Unreal Engine is also popular, uses C++ iirc, but is mainly suited for AAA-graphical-quality games generally and FPSes in particular.
  • GameMaker is simple, uses its own language, I think, but you have to pay for it. (I've never used it)
  • You can also use free or open source toolkits like SDL or SFML, e.g. for 2d games.
  • Or just directly use OpenGL and/or DirectX in C++, but then you're missing all the stuff that goes into an engine, including UI elements and such, and have to make it yourself.
  • There's also this (which I have not used): http://haxe.org/
But you can use just about anything you want to, of course.

Of those, I've never used Unreal Engine, GameMaker, or Haxe, but have used Unity, SDL, SFML, and the manual approach to graphics stuff.
« Last Edit: June 06, 2016, 11:40:15 am by Shadowlord »
Logged
<Dakkan> There are human laws, and then there are laws of physics. I don't bike in the city because of the second.
Dwarf Fortress Map Archive

itisnotlogical

  • Bay Watcher
  • might be dat boi
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9692 on: June 06, 2016, 11:56:51 am »

Game Maker is alright, if you're really willing to make it work. However, Game Maker uses its own language, which means it will be more difficult to find help with a given problem. Not helping this is the fact that Yoyo's documentation outright lies about some things, such as how instance order works.

In addition, experience in Game Maker can't really be transferred anywhere else. I learned a whole lot about C# by forcing myself to use Unity, which I could conceivably transfer to a non-Unity project—not so with Game Maker.

All in all, I'd recommend Unity. It's difficult, but not so difficult that a total beginner can't get anything done. Unity's tutorials are generally pretty good, and there's tons of third-party tutorials for more advanced things you might want to do later on. It's also got some pretty neat features for 2D mode coming some time in the future.
Logged
This game is Curtain Fire Shooting Game.
Girls do their best now and are preparing. Please watch warmly until it is ready.

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: if self.isCoder(): post() #Programming Thread
« Reply #9693 on: June 07, 2016, 12:14:49 am »

Depends what you want to do, and what you already know, and what you're willing to learn.
+1

...

My hobby dev stuff is in Python because it does everything.
Logged
Please don't shitpost, it lowers the quality of discourse
Hard science is like a sword, and soft science is like fear. You can use both to equally powerful results, but even if your opponent disbelieve your stabs, they will still die.

Emma

  • Bay Watcher
  • Romace plots aren't actually that bad
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9694 on: June 07, 2016, 12:57:51 am »

Can anyone explain the difference between a long integer and an integer to me?
 
Idle question: supposing one wished to do hobby game development in one's spare time, what language would one do that in?
It's been mentioned before and I'll suggest it again, Unity. The tutorials are pretty good but it's simple enough and the documentation is comprehensive enough to make learning it yourself easy.
Logged

TheBiggerFish

  • Bay Watcher
  • Somewhere around here.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9695 on: June 07, 2016, 01:02:52 am »

Can anyone explain the difference between a long integer and an integer to me?
I'm making a wild guess, but the long one probably has greater maximum/minimum.
Logged
Sigtext

It has been determined that Trump is an average unladen swallow travelling northbound at his maximum sustainable speed of -3 Obama-cubits per second in the middle of a class 3 hurricane.

frostshotgg

  • Bay Watcher
  • It was a ruse
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9696 on: June 07, 2016, 01:06:19 am »

The difference depends on your compiler and language of choice. The C++ spec doesn't actually specify beyond that an int should be 4 bytes and a long should be at least as big as an int, so sometimes a long will be 4 bytes and sometimes 8 bytes. Java specifies 4 byte ints and 8 byte longs. C# has 4byte ints and 8byte longs.

Basically, it's a size thing if there's any difference at all. Your best recourse is to google, but int is almost always 4 bytes and longs are usually 8 bytes but sometimes 4 bytes.
Logged

EnigmaticHat

  • Bay Watcher
  • I vibrate, I die, I vibrate again
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9697 on: June 07, 2016, 01:08:35 am »

Nuclear Throne and Undertale were both made in game maker.  Who knows, maybe you'll be the next sensation :P  Game maker seems to be ideal for developers with a simple game loop in mind and some other skill (writing, graphics, sound design) that outstrips their programming knowledge.

It'd like to throw Microsoft's XNA framework, or its spinoff Monogame (same thing, much more multi-platform), into the ring.  It uses C# which in my experience isn't a huge jump from python (others may disagree), and it provides fairly simple implementations of all the necessary bits you need for a game.  If you're into 2D stuff its a good way to go.  Great tutorials for XNA, also has Monogame tutorials on the same site

Personally I found Unity to be a pain in the ass.  It encourages/forces you to use its game entity objects which can have pieces of code attached to them, but referring to game entities or the code inside them from outside the game entity is needlessly difficult.  Or at least it seemed so to me in my brief time messing with the engine.  Also worth pointing out with Unity that their web player got nuked by Chrome.
Logged
"T-take this non-euclidean geometry, h-humanity-baka. I m-made it, but not because I l-li-l-like you or anything! I just felt s-sorry for you, b-baka."
You misspelled seance.  Are possessing Draignean?  Are you actually a ghost in the shell? You have to tell us if you are, that's the rule

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: if self.isCoder(): post() #Programming Thread
« Reply #9698 on: June 07, 2016, 01:11:49 am »

Can anyone explain the difference between a long integer and an integer to me?
Ints take up a minimum of 16 bits, longs take up a minimum of 32 bits.
Logged
Please don't shitpost, it lowers the quality of discourse
Hard science is like a sword, and soft science is like fear. You can use both to equally powerful results, but even if your opponent disbelieve your stabs, they will still die.

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9699 on: June 07, 2016, 01:49:33 am »

Can anyone explain the difference between a long integer and an integer to me?

Generally, a standard integer is 32 bits, and a long version is 64 bits. The concept of a "long" version of any type is generally double the data length. But what they're actually called depends on the vendor of the language / compiler, and the generation.

e.g. in c, "char" was 8 bits, "int" was 16 bits, and "long" was 32 bits. They come in unsigned or signed versions. e.g. a signed char can hold -128 to 127, whereas an unsigned char holds 0 to 255.

In c++, "char" is still 8 bits, "short" is 16 bits, and "int" is 32 bits. Unfortunately, things get complicated for "long" because originally, c++ left this as 32 bits as well, but some later compilers pushed it to 64 bits, whereas others implemented a "long long" type for 64 bits.

You can basically bank on int meaning 32 bits, but if you really need 64 bit ints and you want your program to work cross-platform, you should use the types specified in stdint.h, which was created to get around the multiple-vendor/platforms problem.

itisnotlogical

  • Bay Watcher
  • might be dat boi
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9700 on: June 07, 2016, 02:58:50 am »

Personally I found Unity to be a pain in the ass.  It encourages/forces you to use its game entity objects which can have pieces of code attached to them, but referring to game entities or the code inside them from outside the game entity is needlessly difficult.  Or at least it seemed so to me in my brief time messing with the engine.  Also worth pointing out with Unity that their web player got nuked by Chrome.

I'll dispute this. In order, from simplest to hardest, the ways I can think of to access a script on an object from outside that object:

Spoiler (click to show/hide)

Also, WebGL is much less hassle for players who would otherwise be turned away by having to install the Web Player plugin. Also, WebGL is much more cross-platform than WebPlayer, which IIRC was Windows-only.
« Last Edit: June 07, 2016, 03:04:37 am by itisnotlogical »
Logged
This game is Curtain Fire Shooting Game.
Girls do their best now and are preparing. Please watch warmly until it is ready.

Emma

  • Bay Watcher
  • Romace plots aren't actually that bad
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9701 on: June 07, 2016, 04:59:08 am »

Personally I found Unity to be a pain in the ass.  It encourages/forces you to use its game entity objects which can have pieces of code attached to them, but referring to game entities or the code inside them from outside the game entity is needlessly difficult.  Or at least it seemed so to me in my brief time messing with the engine.  Also worth pointing out with Unity that their web player got nuked by Chrome.

I'll dispute this. In order, from simplest to hardest, the ways I can think of to access a script on an object from outside that object:

Spoiler (click to show/hide)
Spoiler (click to show/hide)
Logged

3man75

  • Bay Watcher
  • I will fire this rocket
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9702 on: June 07, 2016, 08:15:45 am »

Since what I posted was a bit hard to follow I'll post it again. I am using an IDE, Eclipse (Mars) by the way. It's just that like I said that my laptop was open and on while I typed away at the forum via another pc. My wifi in the house dosen't work so I coudn't use my laptop to post on the forum.

Spoiler (click to show/hide)

Working on fixing a few things still for the OOP version. Thanks @Reelya for the help.

Also you may notice that this code dosen't run and that's because I fiddled with it after it was working to try and get multiple dice to work on it. As I have said before, no dice. Pun intended ;)

EDIT:

Having a hard time visualizing what I need to do. This is a guess but..

1. Public Class Dice.

2. Make traits for Class Dice. Such as int sides.

3. Make a function that 'gets' sides. You know like getSides.

4. Another function transfer whatever getSides is (It will be int something) and put it in a roll function.
       - random
       - random(getSides) + 1;

This seems like a good track from guess work. Btw I was looking at Reelya's suggestion and formulating as I type. This still leaves me with two questions though: 1. How to make multiple rolls and 2. the actual coding.

I know I can't be helped with the last one, that's what my 80$ book is for, but how can I get it to roll more than once? Can I make another function that does that seprately?

something like...

class DiceXXXXX

while (userwanted to roll){

random(getSides)+ 1;
}

Not sure if that'll work since I tried it before...Either still working on all of this.
« Last Edit: June 07, 2016, 08:53:00 am by 3man75 »
Logged

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9703 on: June 07, 2016, 11:51:53 am »

You don't need a "getSides" function at all. Any variable defined inside a class' scope is accessible to all functions in that scope.

But before you add anything, I highly recommend you trim all the useless code. You have three separate scanners, but you only need one for the entire program. It's annoying and it makes your code hard to read.

Just use a for loop to roll a number of dice. But I highly recommend that you move all the input and output code to the main function, and not spread it around in other functions/classes.
« Last Edit: June 07, 2016, 12:17:07 pm by Reelya »
Logged

TheBiggerFish

  • Bay Watcher
  • Somewhere around here.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9704 on: June 07, 2016, 06:20:55 pm »

You don't need a "getSides" function at all. Any variable defined inside a class' scope is accessible to all functions in that scope.

But before you add anything, I highly recommend you trim all the useless code. You have three separate scanners, but you only need one for the entire program. It's annoying and it makes your code hard to read.

Just use a for loop to roll a number of dice. But I highly recommend that you move all the input and output code to the main function, and not spread it around in other functions/classes.
**THIS IS IMPORTANT**
You don't need a getACertainVariable() to access aCertainVariable WITHIN the class.  If you want to see what it is OUTSIDE of the class you need a getACertainVariable() method.

Also, you only need one Scanner pointed at System.in for ALL of the input you're doing within your main method.
Logged
Sigtext

It has been determined that Trump is an average unladen swallow travelling northbound at his maximum sustainable speed of -3 Obama-cubits per second in the middle of a class 3 hurricane.
Pages: 1 ... 645 646 [647] 648 649 ... 796