Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (576)
games submitted by our members
Games in WIP (498)
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] 2
1  Game Development / Newbie & Debugging Questions / Re: Loading an Image only once and using it in multiple objects [Solved] on: 2011-10-11 04:03:20
+1

Also it doesnt matter if you are not doing the work for someone else. When its just you and YOUR project remember its YOUR project. You are the boss. Quite personally I switch back and fourth between singleton and objects. Both of them have their places otherwise one or the other would be missing from java as the language in large.
2  Game Development / Game Mechanics / Re: Moving Levels on: 2011-10-11 03:55:20
Unfortunately  the only way I know how to manage this with the least modification would be to have two co-ordinate systems.

Imagine a window where everything inside of it is drawn and everything outside of it is not drawn. This window has a width a height and a position. Usually this position is the center of the window.

So one way would be to say "Is object x within the window (is the x position greater then the window x - 1/2 the window width and is less then the window x + 1/2 the window width) etc.

Whatever is in the window is then drawn but not to world co-ordinates ... to screen co-ordinates.

3  Games Center / Showcase / Re: Zombify on: 2011-10-11 01:00:25
Cry my screen is not big enough to show the buttons to play ... al I can do is look at the pretty menu screen
4  Discussions / General Discussions / Re: Google PlayN on: 2011-10-11 00:53:49
sounds like pure uncut awesome sauce!
5  Game Development / Newbie & Debugging Questions / Re: Enums ! on: 2011-10-10 15:00:32
I remember working on reverse engineering the communications of a game. Some objects in the game allowed the user to interact with them and a random numbr was generated. When we started digging into to communications we found that the number was being generated client side then was sent to the server so all of the clients would see the result. In this situation they were not using enums and an invalid number did one of two things, A) if set to 0 the animation for that item kept going. B) if set to more then 8 or less then 0 the item would crash all clients viewing that item.

All in all it was very entertaining to watch the problems produced by poor coding (no data verification nor range checking of the client)
6  Discussions / Miscellaneous Topics / Re: Java vs. C# on: 2011-10-04 19:20:00
Once again, all of this is from my point of view. It is not saying everyone has the same experience.


Further Windows 8 is getting a Windows store, with distribution integrated into Visual Studio. This will allow you to sell C# projects much easier. C# also has the XNA Community Developers channel (or whatever it's called), which allows you to sell your XNA games on the 360. It's not massively popular, but some people have made a decent amount of cash.

Like I said from my experience. XNA requires license which costs money when you want to distribute. I believe the Microsoft store will be the same. On the same lines microsoft store does not target multiple platforms just windows 8. In the targeting a single platform you have the android marketplace. I can understand people have made money on both but when it comes to just dipping your feet in then java wins due to lack of fees.

If you are using threads, OpenGL, Swing, Java2D or anything involving audio, then you can easily encounter cross-platform issues with Java. It's far better then C#, but far from perfect.

If you target difference devices, then you do need to be platform specific. Different screen sizes, input configurations, and other factors make this a reality in any language, including Java. For example lots of Android apps work badly on Android tablets, simply because they just weren't designed for a larger interface.
I have not encountered a problem with Java other then having the proper libraries which also happens in windows.

The different device targeting issues are problems with any language.

Also if you were to use an installer for a java application the necessary libraries can be loaded on the system. If you wern't worried about size then you could even pack a VM in with your application and run it from the install directory.

Microsoft have their own Robotics Developer Studio, where as with Java it's mostly a collection of various third party tools and libraries. As a result, you have to hack a lot of the bits together yourself. I have some experience using Java with simple robotics, and the fact is that most of these libraries are very hit and miss. Some work, whilst others tragically fail.

Lego Mindstorms, one of the best robotics kits for learning, works with both Java and C#. However it's also supported with the Microsoft Robotics Developer Studio.

Diversity, I'd say Java wins, but for maturity, I'd say C#.

Again from my experience. Javas hit and miss is due to third party development. You are comparing a broad set to a specified set. Like comparing Schwinn to all automobiles.

Also from my perspective. I use Java because my robot run environments are mostly linux based.

Also the collection of various tools and libraries is once again due to people developing for different platforms. Not all robots are the same, not all platforms are the same, not all objectives are the same. If you are using a broad range of open source libraries you will encounter this in any language in any standpoint. That is the fun behind hacking code. Take a graphics library from a video game, database setup from a enterprise application, communications stack from another application. No they are not going to fit you have to make it either by tape or hammer.

Half true.

Old mobiles use J2ME, which uses Java 1.3 for the language, and their old APIs. It is also heavily dated, and only popular in emerging economies (namely China, India and Latin America). Android uses it's own VM, which has a mix of standard and non-standard libraries.

But the most important mobile platform is iOS, since it has the biggest ecosystem, and over 90% of all mobile applications are sold on iOS. Here C# has products such as Mono Touch and Unity, which allows you to build C# games/applications for both Android and iOS, using Mono. iOS development using Java is mostly non-existent (there are some proof of concepts floating around online).

For very old phones, Java wins hands down. For Android, Java wins, but C# is pretty good too. For iOS, which is the one that matters, C# wins.

Yes iOS has a large portion of the market but android has a more diverse base. Android apps wont run on iOS and iOS wont run on Android but as far as the number of different devices Android is better. Android is on the rise and with jobbs retiring I believe that apple will soon to be on the fall.

Jumping back into the other side of the problem. Doesn't it cost money to develop applications for iOS or at least royalties?


The JRE is far more popular then Silverlight. However Applets are partially blocked in Chrome, and Mozilla might be following suit. Both Java and Silverlight are fully blocked in Metro, but you can easily port Silverlight apps to Metro.

Due to exploits. Someone will find some for silverlight soon.

However Applets are universally worse then Flash, Silverlight or HTML5/JavaScript, due to the terrible startup times, lack of modern UI's, endless certificates for anything sophisticated, and a bad model for handling incorrect versions and plugin updates.

Agreed, but don't forget that Applets are but a part of web development.

For converting to HTML/JS, there is GWT for Java, which is outstanding. But there is also Script# for Silverlight, which is used heavily within Microsoft (I believe Hotmail is built using it), and so it's also pretty mature. There are other alternatives for C#, such as JSC (but I'd go with GWT or Script#).

So if your using a plugin, Java is more popular, whilst Silverlight gives a far superior experience, but neither are the best (I'd recommend Flash of HTML5/JS). For converting to HTML5/JS, Java wins simply because GWT has more use/examples/libraries/ecosystem, but C# is still an excellent choice.

As a side question, has anyone had any good luck with silverlight and linux? I have not even tried.

Now theres another part of web development that you missed ... server side technologies! Apache has Tomcat which is a JSP server. So you end up mixing elements of java and html together. While I agree that Applets are dated and have issues (Its an older technology) C# still has a lot of ground to make up.

Now we can compare Java and Flash all day but we are trying to focus on Java and C#.

Once again all of this is from my view.
7  Discussions / Business and Project Discussions / Re: DRM ideas (actually just copy-protection) on: 2011-10-04 12:05:42
I hear you can hire an armada if you have a pirate problem ...


Any who an offline game will have problems (Hell look at steam games ... you can get them for free if you look hard enough)

But if you require a user account ... that has paid access then your talking more DRM.

Its easy to throw in some encryption and tweek it so its difficult to break. The time spent on reverse engineering a mutating key encryption will be enough to keep most away. Then they would have to reverse engineer communications. That's made difficult my nonsensical communications. (For example instead of saying Move player X to (X,Y) say YG8sug7, G(&IHHh, or ^&ygf ... yes you can make the same data appear different! at different times) Hell throw in some false data to throw them off too!

Eventually it will be broken someone will make a server and people will be playing for free, the only counteraction to this would be having:
A) popularity in the MMO way (people would rather play with each other then by themselves if the games is designed such)
B) Have the main content of the game stored and executed on the server (Eg a quest the story etc)
C) Making enough money to not worry about it

Regardless of what you do, as others have stated ... you have 99 problems and a DRM aint one.

(Ha on that last one ... I need sleep)
8  Discussions / Miscellaneous Topics / Re: Java vs. C# on: 2011-10-04 11:48:55
Personally I prefer Java:

I don't have much experiences with c# so the following are educated guesses at most. If I am wrong its because how c# has been represented to me.

Yes you can develop for free but actually selling a product takes more effort on c#
Point Java

Yes you can use C# on linux but some things don't work and some things only half work
Point Java

Yes you can do robotics with both but I have encountered more java then c#
Point slightly java

Mobile development More java done then c#
Point java

Web based applications
Point Java


Some side notes. In the end we may want to sell something. You could do it under the table but what happens when you want to expand get bigger. Sure you could risk it but eventually you will need licensing. On top of that more games are being developed being cross-platform Java already does this so there's no need to recompile or hack in different libraries.
9  Discussions / General Discussions / Re: Finishing is hard. on: 2011-10-04 11:09:56
We're in the last stretch of this project. It's a lot of f**king work. Sorry for swearing. The fact is, some of us are sad people, and we really want to realize our dreams, even if they're stupid. I'm 34 years old, and almost at the career death knell of 35. Do I care? No. If I can finish this project, I'll die a happy man.

That's the difference between design and development. For some one is easy for other the other is easy. Usually having the ability to do both is the magic ability.

It happens a lot in web programming. Developers make the data accessible and organized then the designer makes it look good.
10  Game Development / Newbie & Debugging Questions / Re: Infinate Map Co-Ordinate question on: 2011-10-04 00:32:24
Patch just for your strange gfx setup! use the switch -window to run in an 800x600 window
11  Game Development / Newbie & Debugging Questions / Re: Infinate Map Co-Ordinate question on: 2011-10-03 23:33:20
wow I did not plan for resolutions above 800x600 lol why is the only mode available so large >.> and at 0hZ straaaaaaaaaaaaaange.
12  Game Development / Newbie & Debugging Questions / Re: Smooth Camera on: 2011-10-03 23:31:46
So say that in the last frame your guy and camera was at 0,0 The next frame the guy has moved to 20,20. so the error is 20 in the x and 20 in the y multiply each number by a scaling (smoothing) factor and it will approach the center of the object.

Also consider that when the camera is "close enough" that it just stops moving otherwise it will twitch continuously.

If you wanted the camera to be "no further then x" then you take the error (in the above case 20) and divide it by the maximum you want it to be off. If that number is more then 1 or less then -1 then calculate how far to get it in bounds or double the change for the position
13  Game Development / Newbie & Debugging Questions / Re: Strange Deadlock in Window.setBackground() on: 2011-10-03 14:52:56
Sometimes a hack is required XD. As long as I don't get a lock while developing I am cool. I will look into it more in detail after most - all of the core features are finished before I start making content.
14  Game Development / Newbie & Debugging Questions / Re: Strange Deadlock in Window.setBackground() on: 2011-10-03 14:09:34
Thanks for the sample. I was doing those in that order. I set what settings that I could in the EDT. Then what I couldn't I set ater a short delay. I have yet to encounter a deadlock.
15  Game Development / Newbie & Debugging Questions / Re: Smooth Camera on: 2011-10-03 14:04:01
You may want to also consider using a what I call "slushy" camera centering algorithm.

Basically you do something like this in psudocode:

Find error in X.
Find error in Y.

Camera X = Camera X + error X * max scroll speed
Camera Y = Camera Y + error Y * max scroll speed

If you need more smoothing then look at the rate of change in error as well. Eventually at some point you will exceed the max speed for the camera and you will basically have 2 options (without changing the graphics) Either A) You zoom out (pretty neat to base zoom off of speed) or B) slow player movements.

As always a higher FPS will yield smoother results.

16  Game Development / Newbie & Debugging Questions / Re: Graphics2D applet, what are the most common issues, to take care ? on: 2011-10-03 13:57:36
Once I finish the current round of updates with my engine I will implement an OpenGL version of the graphics manager. I will run the two on the same machine and record the resulting FPS. Then I will upload it to my site so you can check it out for yourself.

Figured I better implement opengl now rather then later when I "need" to.
17  Game Development / Newbie & Debugging Questions / Re: Infinate Map Co-Ordinate question on: 2011-10-03 13:50:04
Or have more tiles per block ...

Just a fyi I uploaded an early prototype to my website last week. I will be doing some modifications and uploading an update by friday.

SatanicSpider.com

Projects -> Software -> Java Game Engine

Sorry bout the sloppy website. I'm building a cms on a different part of my server and slowly integrating it.
18  Game Development / Newbie & Debugging Questions / Re: Infinate Map Co-Ordinate question on: 2011-09-27 07:03:19
+1 I do too. I calculated I can have  a max of 7.37869763 × 10^21 tiles before the int loops back. Dunno If I will have enough space guys. If I switch to longs I could have 1.36112947 × 10^41 tiles but that's still very tight. I will have a demo of the engine available soon.
19  Game Development / Newbie & Debugging Questions / Re: Infinate Map Co-Ordinate question on: 2011-09-26 07:23:28
Block objects are serialized to the disk at the "xy.block" so it can be 00.block or 99-99.block etc. Loading is quick and processor non-intensive
20  Game Development / Newbie & Debugging Questions / Re: Strange Deadlock in Window.setBackground() on: 2011-09-25 03:53:47
No not from edt. Should I be?
21  Game Development / Newbie & Debugging Questions / Re: Strange Deadlock in Window.setBackground() on: 2011-09-24 20:01:47
I Create a JFrame. Remove decoration and remove re sizable so it is a plain screen. Then I set the full screen window of the graphicsdevice to the jframe. Then I use getFullScreenWindow and set font, background, and foreground in that order. Deadlock occurs at the set background. Figured if I commented it out it would just lock up at the set foreground. I probably am not setting enough time between creating the full screen window and getting it again. Its probably giving me some other window.
22  Game Development / Newbie & Debugging Questions / Re: Infinate Map Co-Ordinate question on: 2011-09-24 19:55:00
Now you got the math worked out. How do the blocks work? I'm guessing you will have X number of blocks loaded at a given time, and as the player moves in one direction, you will load more blocks that way and remove blocks in the other direction.
Yes I have a 3x3 array of blocks. When the block_x or block_y changes it shifts the array accordingly and loads fresh blocks into the row or column. So say you are going left and you jump into a new block space.
(from 0)
(2,0) = (1,0)
(2,1) = (1,1)
(2,2) = (1,2)

(1,0) = (1,0)
(1,1) = (1,1)
(1,2) = (1,2)

(0,0) = Load(block_x-1, block_y-1)
(0,1) = Load(block_x-1, block_y+0)
(0,2) = Load(block_x-1, block_y+1)
23  Game Development / Newbie & Debugging Questions / Strange Deadlock in Window.setBackground() on: 2011-09-24 06:55:21
So 1 out of 150 application launches causes a deadlock in the java vm. I traced the code down to a single line

1  
w.setBackground(Color.GREEN);


Where w is a Window object.

Like I said this does not happen each and every launch just 1/150.

What I mean by deadlock is in my terminal window I can do ctrl C and there is no response  Shocked. Ctrl Z kills the process but leaves the window open (in fullscreen ... with no decorations I mind you).

Any ideas? Maybe a delay from creating the window to changing properties?
24  Game Development / Newbie & Debugging Questions / Re: Infinate Map Co-Ordinate question on: 2011-09-24 05:22:38
Hah i actually completely forgot about modulus -_-

I use it all the time why not here??? Who knows.

Simpler form
tile_x = (Player.X/r_width)%tiles_per_block_x;

I am tooooo tired today.
25  Game Development / Newbie & Debugging Questions / Re: Infinate Map Co-Ordinate question on: 2011-09-24 04:14:43
Doh! Gotcha. My maths are a little skewed with the little sleep I have been getting.

Just kidding. Still dont have you. Same example

r_width of 5 and 2 tiles per block

Now lets move player to 303 which should be block 30 tile 1 (starting at 1) {29 0 starting at 0}
(Player_x - (r_width * tiles_per_block_x) ) / r_width
(303 - (5 * 2) ) /5 = (303 - 10) / 5 = 293 / 5 = 58.6 (int) = 58

58 is a little out of bounds for the array

lets try - Tiles and blocks starting at 0
block_x = Player.x / (r_width * tiles_per_block_x) - 1
 = 303/(5*2) = 303/(10) - 1 = 29.3 (int) = 29

tile_x = (Player.X/r_width) - (block_x*tiles_per_block_x)
= (303/5)-(30*2) = (60.6) - (60) = 0.6 (int) = 0



26  Game Development / Game Mechanics / Re: best way of loading character(player) files? on: 2011-09-24 04:11:11
Serialization is fast, but it's awesomely brittle.  Any change to the class, and you can no longer deserialize it without littering your class with weird schema evolution code that you can't put anywhere else.  It's good for short-term caching and shoving objects over the wire, but it's highly inappropriate as a long term persistence format.


I could argue the exact opposite. If your object is at its final revision then there is no chance of breaking. Now if you had to do an update you could keep the old version of the code and load the object into that class then construct an object from the new class then re-serialize it and re-write it to the same file
27  Games Center / WIP games, tools & toy projects / Re: God rays on: 2011-09-24 04:03:32
Any more screen shots?
28  Game Development / Game Mechanics / Re: best way of loading character(player) files? on: 2011-09-24 02:05:28
I'd actually love to see this since we're going to be using serialization for our level editor.  Would be really cool to see another approach, and we'll post ours when it's done as well.

Fixing some comments and will post shortly after
29  Game Development / Newbie & Debugging Questions / Re: Infinate Map Co-Ordinate question on: 2011-09-24 01:20:35
If its the global position, then wouldn't Player_x / r_width give you the tile location (of all tiles) then divide that by tiles_per_block_x, to get you block location. Right?
So Player_x/r_width/tiles_per_block_x?
That's the same as
block_x = Player.x / (r_width * tiles_per_block_x)

for example:
20/5/2 = 4/2 = 2
20 / (5*2) = 20 / 10 = 2

Then (Player_x - (r_width * tiles_per_block_x) ) / r_width would give the tile location within that block.
Right?

I think that is incorrect.
That simplifies to Player_x/r_width - tiles_per_block_x
which would be Global tile location - tiles_per_block if I maths right
30  Game Development / Game Mechanics / Re: best way of loading character(player) files? on: 2011-09-24 00:37:25
Personally I have been experimenting with serialization A LOT lately. I like that I can instantiate an object fill its fields tweek its values then save it to a file or send it over any stream (including a socket).

I wrote a couple classes last week to facilitate loading and saving of serialized objects. If you would like I can post the source.
Pages: [1] 2
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (18 views)
2014-04-15 18:08:23

BurntPizza (15 views)
2014-04-15 03:46:01

UprightPath (28 views)
2014-04-14 17:39:50

UprightPath (13 views)
2014-04-14 17:35:47

Porlus (29 views)
2014-04-14 15:48:38

tom_mai78101 (54 views)
2014-04-10 04:04:31

BurntPizza (111 views)
2014-04-08 23:06:04

tom_mai78101 (212 views)
2014-04-05 13:34:39

trollwarrior1 (181 views)
2014-04-04 12:06:45

CJLetsGame (187 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
java-gaming.org 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‑gaming.org
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!