Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Discussions / Miscellaneous Topics / Re: if you are not a programmer, what would you be ? on: 2013-07-10 17:28:28
a chia-pet, or Soldier A (never soldier b)
2  Game Development / Newbie & Debugging Questions / Re: Makeing dungeon system should I use a 2d array on: 2013-07-10 11:26:47
     Thank-you for the insight. I like the sound of a rougelike game and I think that the story idea behind the game would probably fit this type of game. However I'm not sure the difference fully is. The game has three option at any point when not in a fight or event. Go, Search, and rest. Go I would like to use to move the player from room to room however all it does is get the next room. If I choose to use the method you detail with out a drawn map but how would I pull up the next room with it. I do like the idea of the rouge like game but I would like to just finish what I have. At this moment rooms are like containers that hold enemies items and events. I don't know if thats bad practice or something.

I obviously am just going to have to dive into and play with these things.


I was trying to make a map like
#  # 

just to start but each room is a object so I was calling them by getting there index and changing what index was being referenced. however I was unsure how to code the getting and finding out if there was a room to the right. Would I assign each with a XY value and then test to see if the player is next to that value? and then test each of the objects in the arraylist (im reading the tut on collection and colletion api right now) to see if they have the same value?

Sorry if any of these question are confusing I'm still pretty fresh in the all this. Again Thank-you for the help

yes, that is essentially what you would do. there are many ways to do it, but that is the most common method. there are a lot of ways, but most of them do pretty much the same thing.
3  Game Development / Newbie & Debugging Questions / Re: Makeing dungeon system should I use a 2d array on: 2013-07-09 08:09:45
Don't use arrays for this stuff, use collections like List, which will let you do far more than arrays.  If you need an extra dimension, use a List of Lists, and also look at things like Map while you're at it.

Arrays do have their uses, but not in a text-based game.

Actually, i think what they mean is that they want to make a text based roguelike, which usually IS made with 2d arrays (or 2d char arrays, at least). i think that the confusion is because there is also the old fashioned text based RPG games where it's just dialogue and you loosing hp.  usually roguelike games have maps that look almost EXACTLY like this:

##                                              G
############    ########    ##
##M            M##    ######        ##
##                ##    ######        ##
##                      M############
############                        ##
######################    ##
##                                ####    ##
##    ######    ####    ####    ##
##    ##              M##    ####    ##
##C  ##                ##                ##
##    ######################

Okay sorry that the question is so confusing. I'm just really unsure and confused myself.

My Room object repersents whats inside the current room ie. enemies to encounter, and items to find, I'm also considering it holding events but this isn't implmented yet.

I then have another object called -_- locationObject which holds an arraylist of the rooms.

current progrssion in the game is done by adding(or subtracting) one to a variable called currentRoom and then getting the object at the index inside the arraylist in the location object.

I realize 2D arrays can be done with things like String[][] however I'm unsure how to use it to create a map that the player can move around in beyound going back and forth.

When I say lacking depth I'm refering to the fact you can only go from room 1, to room 2, to room3, and back they is no left or west and east from currentRoom.

I have atleast a basic understanding of java.

I'm unsure where the problem is in my logic. Again thank-you for your help.

you need to set 2 variables. have 1 stand for the characters y position, and  1 for the x position.

now do something like this (note that this is not an actual code, it's just an outline of what you need to do):

if buttonup true: 
       check if maparray[x][y+1] has something in it(should return a true or false)
       if false:
              maparray[x][y] = blank space;
              maparray[x][y] = character symble;

basically, you need to do that for each direction. (if down it should be y-1 and y--, if left it should be x-1 and x--, and if right it should be x +1 and x++)

there you go, you now have your character and map working together in perfect harmony. now you basically have to do the same for each mob, (basically, it's a for loop that checks if the slot is taken up by a mob, if it is, then an if statement to see if the player is near by, then if the player IS then you need to do the attack. if it's not, then either randomly move 1 (again, check if the mob can actually move).

basically, that's it. it's really easy and it's also the 'begginers programming to rpgs'. there are actually a LOT of online tutorials that will tell you how to code every single line. though not all use 2d arrays or 2d char arrays. anyway, here is one of the youtube tutorials i found in my favs, (though i have no idea if it uses arrays or not):

4  Games Center / WIP games, tools & toy projects / Re: Sheep! on: 2013-07-08 10:03:00
well, as i don't have an android device, i'm not really sure what the limitations are, but is it possible for the 'user' to use a config setting for the wallpaper? if so, i would just put the 'kill' stuff into an if statement, if the play has it on, then kill the sheep. (PS. if you really want to do the 'kill' thing, have the cheep get attacked by zombie rabbits, or sheep eating carrots, that would be hilarious)
5  Game Development / Newbie & Debugging Questions / Re: An array index out of bounds exception, I know what that means but.. why!? on: 2013-07-08 08:17:13
With a debugger you should be able to make sense of even the most obtuse code.
Stick a break point on the Exception in question, and investigate the state of all the relevant variables at the point the error occurs.

That said, if you can't understand your own code, what chance do others have?

Always endeavor to write code that'll be understandable to others, and yourself 6 months down the line!

if that was true, then people wouldn't use the help forum, as there would be no point. sometimes people make mistakes and can't notice them themselves, so they need us (the community Cheesy) to help them. Smiley Besides, we're all friends here, and more then willing to help. :3
6  Game Development / Newbie & Debugging Questions / Re: [LibGdx] Any tutorials on making a HUD for games :) on: 2013-07-08 08:12:00
Well, most huds are basically 'draw box, draw second smaller box in that box, second box size equals hp over first box size' or something like that. it's not very hard. but if you really want to learn, then i would assume that thecherno would probably have the best tutorials. (sorry, but i always seem to tell people to watch these tutorials):

while i don't think he's gone into how to make an hp bar yet, he has already covered everything you need to know in order to make one (pretty much, all you need to cover is the 'tile' set of tutorials, then you'll know everything you need in order to make a hp bar, as for the text thing, i think this might help you:
7  Game Development / Newbie & Debugging Questions / Re: My First Java Game. on: 2013-07-08 07:58:55
I agree with _Scyth_ for the most part, with 1 small difference.

Before you actually get to making your game, the best thing to do is to do a 'how to make a game' tutorial so you know the basics. the first chunk of pretty much every game (2d graphic based games, i mean) are pretty much the same for the most part. So watching/reading tutorials will help you learn how to set everything up before you actually get programming the stuff you want for your game.

While learning these basic things, and doing the tutorials, you should write down a basic outline of what you want in your game, then fill it out in as much detail as possible. Doing this WHILE learning the basics makes it much easier to learn to think like a game programer, without turning it into a really daunting task. (seriously, just sitting down and saying 'how do i want to have the save system set up, what about the maps and mobs?' seems REALLY scary if you're doing it all in 1 go) Their explanations on things in game programing can also help you come up with with some good ideas on how you want to do things:

For instance, while i was watching TheChernoProject's and coding along (he has the BEST explanations for just about everything, with the exception of saving, even if he does use Notch's codes for the starter) when he explained how his mapping code worked, i actually thought up a really good way of doing something that i hadn't been able to figure out until then:

The idea i got? Well, that was how to do chunk-loading, of course (which he doesn't actually cover, but that's kind of what i mean by getting inspired by their explanations:
Chunk loading ideas:
(Idea 1)
- As terrain is basically read from a text file, then placed on the screen, then having each world made
   out of multiple text files, with each text file holding 4 16x16 (or 32x32) grids of blocks
   (background, wall art, front, extra art), and have the game load each one when the camera
   screen is within 4 blocks of that chunk. (base which map should be loaded by the ID)
- The chunk loading guide file should be handled like this:
- Map Ids are composed of 4 numbers, with each number having 4 sets of letters:
   If(PlayerWalkingLeft==true & x == 0)xn++;
   If(PlayerWalkingRight==true & xn == 0)n++;
   If(PlayerWalkingLeft==true  & x > 0)x--;
   If(PlayerWalkingRight==true & xn > 0)xn--;

   If(PlayerWalkingDown==true & y == 0)yn++;
   If(PlayerWalkingUp==true & yn == 0)y++;
   If(PlayerWalkingDown==true & y > 0)y--;
   If(PlayerWalkingUp==true & yn > 0)yn--;

   LoadMap('x' + x.toString() + 'y' y.toString() + 'xn'+ xn.toString() + 'yn' +yn.toString());

- xn and yn stand for 'x-negative' and 'y-negative'. this should allow for sudo negative numbers (since java doesn't allow for negitives T_T).
have the game use Xn for negative x, and Yn for negative y.

As for the actual game itself, i started writing the basics of what i wanted, which started off like this (yes, this is actually the original file, with the exceptions of the edit notes, lol):

Name: Huh (Name ideas so far: Lemuria, expanse, blank world, or just call it chicken and let people wander why)
Game type 1: Rpg (quest, mobs, exploration)
Game type 2: Adventure (LOTS of exploration)

Character custamization: find out how hard this is. i think it would be a int[] based thing, with each slot corresponding to a
                                   specific body part or something, and each number representing which image to use. (note: it is)
Species: have the player be able to choose their species, have many different speces (maybe make them randomize, with
                                   their body parts be picked out of a random 'body parts:
                                                      -Head extras
                                                      -Torso extra

Special things: Farming, crafting, mining, fishing (erm... harvesting maybe...)
Combat system: Anything but overworld fighting. i HATE ZELDA STYLED FIGHTING SYSTEMS
                       (note: was i on something when i wrote that? lol, this is actually what i went with)

Art type: 2d tile style (old school rpg, like star ocean 2, golden sun, final fantasy 1-6), not iso, side scrolling platform, or 3d
                       (dear god, find out if 3d is really as hard as it looks) (Note: it is)

Pet system: player should be able to either capture or by pets, or maybe recruit people instead (or both)
crafting system: DON'T DO THE REDICULOUS 'by the recipe' crafting system! I HATE THIS SYSTEM. Maybe make it modular instead?
Ship system: Make modular ships.
Weapon system: MODULAR WEAPONS! i hate it when games have only a hand full of weapons. (also make explody things)

housing system: Player can by land or build anywhere (decide later), houses should be modular inside, but house graphic should be
                       based on basic 'build' or 'basic house design'. or something.
storage system?: no idea how to do this.
Inventory system: Make the inventory size based on a changeable int, so that the size can be 'upgraded'.
                       (base size 10-20, somewhere in there)

Exta notes: make as much of it as possible be randomly generated.
Masic: Basic spells, healing, fire, water, lightning

Modding: Make it possible for players to mod it.
Multiplayer: figure out how to do this, and if it's worth going into)
BIG NOTE: MAKE ENDLESS. spores' supposed 'endlessness' sucked, make an actual endless game, or a game that is as good as endless.

Then i went in depth about everything that i wanted. i detailed the mobs i wanted (even went into how many different slimes i want, every rpg needs it's obligatory slimes) the weapon 'parts', the 'ores' and 'mine-able things'. and all of that, and then i thought about how i would do them. (chunk-loading came up during this, which is when i started having problems)

Anyway, the first 2 things you need to do, is think about what you want, and learn the basics. here are 2 tutorial series that you should watch (both are on going, but they already have everything you need): - I learned MOST of what i needed from watching TheChernoProject's first 20-30 videos on his 'java game programming tutorials' (NOT THE 3D ONES! just the regular) - MrDeathJockey's videos taught me what Thechernoproject didn't. (I only watched MrDeathJockey 'java intermediate tutorials')
8  Game Development / Newbie & Debugging Questions / Re: Storing levels on: 2013-07-08 06:51:20
There are 3 options, and really, there are only 3 options that cover how everyone deals with file storage.

1) Hard code it

Store all your level design and objects hardcoded within the game. It completely alienates a lot of users from modding your game and makes it a little more difficult to do a quick fix in your levels. But, hey... the people will have to crack your entire code base in order to crack the game.

Java has a special serialization method that allows you to save states of its classes. It is a compromise between this option and option 2.

2) Put the data in a text file

This method takes your game data and puts it into a text file. Keep in mind, the extension does not have to be .txt. You can name the extension whatever you want. Also, you do not have to store the data as UTF-8 characters. You can store the data as a mixture of bytes, chars, and longs. As long as you are able to read the data back into the game you are fine.

This covers a lot of ways to store data, and is by far the one used by most indie and development companies working on large games. It includes most scripting languages like Lua, JSON, and XML. It also includes just writing your data into a basic text files under .txt and picture files like jpeg and png. You can also use this method to store data into binary.

The most important aspect is that you are able to read the data in and out of any format you put in the text file.

3) Store it online

This is really an extension of Option 2. But there is a few tools like MySQL and data servers where you can store all your data online and have the clients read off the server data. Of course, your clients will be out of luck if your system goes down, but MMORPG's and other online gaming outlets all use this method of storing data.


Best way to handle it is possibly Option 2. It takes a little bit longer to write code that'll be able to allow for custom objects and level design in the game. In the end though, it makes it a lot easier to expand your game to make more levels and objects.

Thank you, thank you, thank you. this explanation just saved me so many questions (i had been told that serialization was the best way and the only option if i plan to allow players to play multi-player if they want, but this explanation contradicts that, and seems to actually explain it a bit more then others did.)
9  Games Center / WIP games, tools & toy projects / Re: Sheep! on: 2013-07-08 06:30:39
You said it 'i know it doesn't look like much', but i think it actually looks pretty cool (to bad my phone can't use it, darn T_T). but i like it.
10  Game Development / Newbie & Debugging Questions / Re: Makeing dungeon system should I use a 2d array on: 2013-07-08 04:56:16
?_? what do you mean it isn't possible to do a 2d array? 2d arrays are done as :

private Array[][] map;


 private Array Money[][];

(can also be public instead of private, and various other things)

the '[]' doubled up make it into a 2d array, if there were 3, then it would be 3d array (there isn't a limit, but please note that the more dimensions it has, the more memory and processor usage it takes up)

Anyway, basically the map coding is pretty much the same for 2d games AND text based games, (if you actually mean the map when you say 'room object'. sorry, but there are dozens of things that 'room object' could mean, i'm assuming you mean a 2d text map with # as walls and things like that since you want to know about 2d arrays)

If that's not what you mean, then could you give us more information? (Ps. don't worry about being new, so long as you know the basics of java, we can help)

And don't worry abou
11  Game Development / Newbie & Debugging Questions / Re: (question) Tile mapping: 1d, 2d, or 3d Array? on: 2013-05-22 14:42:01
Which is faster for PCs/Macs?

One thing I have learned is not to worry too much about performance unless you know it's going to be an issue (e.g. bad algorithm scaling). Instead, when you start off, do what reduces the conceptual weight of the project, what makes it easier to wrap your head around, as that is more important. If you can't figure out how to do something at all, then what is the point of making it fast?

From what I got from this, I think the 3D arrays are the way to go, either one big one, or 3 separate ones.

where (x, y) is the world coordinate, and z is the layer you want to reference (0-5).

or you could have it [Z][X][Y], or any other order for that matter, just be consistent in the code haha!

Yeah, after giving it some thought, I've decided to go with this. I realized, after a bit, that doing a 1d array would make trying to program the chunk loading a pain,  and having multiple 2d arrays would probably just waist time, as a 3d array does the same thing, and takes less coding.

Anyway, thanks everyone for your impute. Cheesy
12  Game Development / Newbie & Debugging Questions / (question) Tile mapping: 1d, 2d, or 3d Array? on: 2013-05-20 17:43:00
Hello, I've recently started programming a game, (I mean, VERY recently). I have just gotten to the 'tile map creation' phase, and realized that there are many different methods to choose between.

The way i originally planed to do it, and the way I learned how to do it, was to just have all the tiles in 1 Array, and just augment their position once the array reaches a certain point (say, tile 7 or 8") by shifting the x and y coordinates.

However, i realized that method might not be the best suited for what i am planning to do.

The game i am starting to program is going to have multiple layers, having 2 layers for each type of 'tiles' or image needed:
1 & 2 background/panorama
3 & 4) base tiles (the ground/water)
5 & 6) item tiles/walls/ things that need a see through background

events/mobs just have their on x&y as they are thier own arrays

I need this because i am essentially making a 2d world sim game. you can build, you can farm, you can change the landscape to fit whatever you want, blah. (no, not like terreria/starbound. I'm not making a clone of them. This is styled like an old fashioned rpgs. Like a sandbox version of the old 2d harvest moon games)

However, the way i was taught how to do this, was to just do a completely different Array for each layer, but i was thinking, what about 2d arrays and 3d arrays? would one of them be easier to keep track of/program, and would one be faster for a pc to read?

So, my question(s) are:

Should i do multiple 1d arrays, multiple 3d arrays, or 1 big 3d array?
Which is easier to keep track of?
Which is faster for PCs/Macs?
13  Discussions / General Discussions / Re: Registration Activation Quiz on: 2013-05-20 17:23:32
The best method, that i have ever come across, for combating spammers has always been the 'riddle picture' method. Basically, you program a system to output a image (not text) that says something along the lines of 'the first letter in 'Maddison', the second letter in 'box', and blah blah blah.

Because it works similar to multiple captas, and because it tells you to look for a specific letter, so long as you have the image ideas generated at random (so they can't be connected to the answer), it makes it impossible to bot though it.
Pages: [1]
EgonOlsen (61 views)
2018-06-10 19:43:48

EgonOlsen (42 views)
2018-06-10 19:43:44

EgonOlsen (61 views)
2018-06-10 19:43:20

DesertCoockie (241 views)
2018-05-13 18:23:11

nelsongames (142 views)
2018-04-24 18:15:36

nelsongames (141 views)
2018-04-24 18:14:32

ivj94 (883 views)
2018-03-24 14:47:39

ivj94 (144 views)
2018-03-24 14:46:31

ivj94 (795 views)
2018-03-24 14:43:53

Solater (159 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!