Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (549)
Games in Android Showcase (139)
games submitted by our members
Games in WIP (594)
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 3 ... 60
1  Game Development / Newbie & Debugging Questions / Re: JWrapper build not running correctly. on: 2014-12-30 02:59:16
TestApp? You just need to run packr as the docs show.
2  Game Development / Newbie & Debugging Questions / Re: JWrapper build not running correctly. on: 2014-12-29 22:22:47
You can use Launch4j if you are ok with the process running as "java.exe". I tried some other projects, but they were old and no longer maintained (JSmooth included). You can use packr or write your own launcher using packr as an example. packr is a good solution if you are bundling a JRE. It doesn't do system JRE/JDK search at all, so isn't an option if not bundling a JRE. packr is quite minimal and can be a bit frustrating if misconfigured, since it doesn't have an option for a log file. What I did was build the native launcher from the VS project after setting it to be a console app so I can see the damned logging. Ultimately I wrote my own launcher for Spine, based on packr's code.
3  Game Development / Newbie & Debugging Questions / Re: JWrapper build not running correctly. on: 2014-12-29 13:33:53
I tried them all. JSmooth is the only Windows native launcher that works properly for me. Launcher4j launches a java.exe process, which is most of the reason to be using a native launcher. Even JSmooth doesn't work as a service and I don't think works when wrapping a JRE. Also it generates a terrible icon, but I just change that using Resoruce Hacker. Commands to fix the icon:

1  
2  
3  
ResHacker.exe -delete build/Clippy.exe, build/Clippy.exe, ICONGROUP, A, 1033
ResHacker.exe -delete build/Clippy.exe, build/Clippy.exe, ICONGROUP, A2, 1033
ResHacker.exe -add build/Clippy.exe, build/Clippy.exe, build/icon.ico, ICONGROUP, MAINICON, 0
4  Game Development / Game Mechanics / Re: Savegame structure for Entity/Component System with complex components on: 2014-12-28 11:49:36
The work has to be done whether you write your own serialization/deserialization or use a library. Kryo does it for you automatically and TaggedFieldSerializer will let you evolve your class while still being able to load previously serialized bytes, again automatically.
5  Game Development / Game Mechanics / Re: Savegame structure for Entity/Component System with complex components on: 2014-12-27 19:14:25
Use Kryo and TaggedFieldSerializer.
6  Game Development / Newbie & Debugging Questions / Re: Libgdx Rotate a sprite 90 degress on: 2014-12-27 16:11:51
Maybe scene2d actions would be easier for you.
7  Game Development / Newbie & Debugging Questions / Re: Solved LibGDX List of Disposable objects on: 2014-12-22 03:53:27
You might check out AssetManager. When you leave scene A, first add all assets from scene B to the AssetManager, then remove all assets scene A used. The result will be that any assets used in both scene will stay loaded, any assets from A that are no longer needed are disposed, and any assets for B that weren't loaded are loaded. Also, loading happens on a separately thread as much as possible, allowing you to have a progress bar.
8  Game Development / Shared Code / Re: Found Really Good Example Off How To Create Vector2! on: 2014-12-21 22:49:40
Well if said beginner doesn't know how to use vectors, then they could just use a library like LibGDX.

...or they could just learn how to use vectors. Mightily useful things they are.
libgdx doesn't hinder learning how to use vectors. Maybe you are implying that writing your own vector class is a good idea? (hint: no)
9  Game Development / Newbie & Debugging Questions / Re: LibGDX List of Disposable objects on: 2014-12-21 16:45:09
When your app exits, everything is disposed. You only need to dispose things explicitly if you need them to be disposed without exiting the app. Eg, maybe you have separate screens and want to unload all the stuff from one screen before you show another. This could make sense if the screens each had a huge map with screen specific textures, etc.
10  Java Game APIs & Engines / Java Sound & OpenAL / Re: Does any1 know any good LWJGL3 OpenAL library? on: 2014-12-16 19:08:25
Here's my OpenAL stuff for LWJGL 2, not sure what it would take to make it work with 3.
https://github.com/libgdx/libgdx/tree/master/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/audio
11  Game Development / Newbie & Debugging Questions / Re: Starting a Java Game, Where to Start? Eventually want to be network multiplayer on: 2014-12-12 10:30:17
Avoiding libraries is only going to hinder you. It is not possible that you finish your project and find you did not learn enough. Having never created a game, you have an enormous amount to learn. Trying to do everything from scratch is going to slow you down considerably. It is a much better idea to get some (a lot) of general experience first before thinking about what happens at a low level. It's the same reason people are suggesting to make a simpler, non-networked game first. You may not like this advice, but you asked for experienced advice and that is what you got.

My advice: use libgdx, specifically scene2d.ui for the UI and SpriteBatch for drawing. Don't use scene2d for the game, only for the UI. Use KryoNet for networking. Organize your code using loose MVC, this will allow you to develop the game as text and later make it graphical, as well as allow you to easily serialize game state and generally keep your code sane.
12  Game Development / Newbie & Debugging Questions / Re: Kryonet sendToTCP/UDP Optimization? on: 2014-12-10 17:02:34
For a game server, it is relevant.
Premature optimization is premature. True it's a lib and it's nice to be as efficient as possible, but in reality the optimization is extremely unlikely to ever make a difference.
13  Game Development / Newbie & Debugging Questions / Re: Kryonet sendToTCP/UDP Optimization? on: 2014-12-09 16:20:24
How many loop iterations is enough to make one array lookup and one int comparison in each iteration slow enough to warrant using a map? Is that number greater than the number of connections your server might ever have?
14  Game Development / Game Play & Game Design / Re: Entity animation in MVC style program on: 2014-11-23 15:41:11
Just make sure you break the rules only at the exact right places. Smiley

Someone playing your game doesn't care about MVC, all they care about is that it works. MVC is for you. If it is making things difficult, cut corners so it doesn't. Eg, put a view object in the model so you don't have to map model to view objects, since you are unlikely to have multiple views.
15  Game Development / Game Play & Game Design / Re: Entity animation in MVC style program on: 2014-11-23 12:35:09
See Super Spineboy:
https://github.com/EsotericSoftware/spine-superspineboy

Character (the model) has state and stateTime:
https://github.com/EsotericSoftware/spine-superspineboy/blob/master/src/com/esotericsoftware/spine/superspineboy/Character.java#L50
The state determines the animation. The stateTime is how long the character has been in that state. This is all you need for the view to be able to animate.

That should be enough to get you going, but if you want to see how Super Spineboy does it, every frame the view calls CharacterView#setAnimation:
https://github.com/EsotericSoftware/spine-superspineboy/blob/master/src/com/esotericsoftware/spine/superspineboy/PlayerView.java#L103
https://github.com/EsotericSoftware/spine-superspineboy/blob/master/src/com/esotericsoftware/spine/superspineboy/EnemyView.java#L93

If the animation has changed, Character#setAnimation changes the animation in AnimationState.
https://github.com/EsotericSoftware/spine-superspineboy/blob/master/src/com/esotericsoftware/spine/superspineboy/CharacterView.java#L51

AnimationState is part of Spine and keeps track of animations, their time, cross fading when animations change, etc. You may not need this, in a simpler system your renderer would just draw the animation for the current state, using stateTime to determine the animation frame.

A couple more notes on how Super Spineboy uses MVC. It is done loosely, you should feel free to break the rules where it makes things easier. The controller is here:
https://github.com/EsotericSoftware/spine-superspineboy/blob/master/src/com/esotericsoftware/spine/superspineboy/SuperSpineboy.java
It does very little.

The model objects have a field for the view but it is never used in the model, it is just for convenience to avoid a model -> view object mapping. There are a few events that the model tells the controller about via a method. I figured proper events would be overkill. Reaction to the events could have gone in the view, but it was easier doing it there.
16  Game Development / Newbie & Debugging Questions / Re: Interpolation between numbers - Libgdx on: 2014-11-15 15:06:07
Great! Though "time += 0.010;" should be "time += delta;".
17  Discussions / Miscellaneous Topics / Re: How memory works? on: 2014-11-15 01:11:13
Try this, IMO it's written in a way that is easily understood:
http://math.hws.edu/javanotes/c1/s1.html
Read the whole thing, it's very good:
http://math.hws.edu/javanotes/
Start at chapter 1 of course.
18  Game Development / Newbie & Debugging Questions / Re: Interpolation between numbers - Libgdx on: 2014-11-15 01:09:03
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
float time = 0;
float duration = 3;
int lastScore = 123;
int actualScore = 456;
while (time < duration) {
   float alpha = Math.min(1, time / duration);
   int visualScore = (int)Interpolation.pow2Out.apply(lastScore, actualScore, alpha);
   System.out.println(visualScore);
   time += 0.032;
}


Once you understand that, apply it to your game. Set time=0 when the score changes, increment time each frame. Pro tip: when score changes, clear actions, then add a TemporalAction that adjusts the visual score.
19  Game Development / Newbie & Debugging Questions / Re: Interpolation between numbers - Libgdx on: 2014-11-14 20:14:05
The Interpolation alpha parameter is from 0 to 1. For your situation, use x/y where x is the amount of time since the score changed and y is how long the you want the visual score change to take.
20  Java Game APIs & Engines / OpenGL Development / Re: LWJGL 3; how's it getting along? on: 2014-11-14 19:03:43
Windows 7 64-bit. No, I don't have the Fire Sans font installed. I'm missing glyphs at that link:
http://i.imgur.com/3eGbUjW.png

Haven't tried upgrading yet, but IMO fonts are pretty important for a site to be usable, you don't want it not working for some users. FWIW, we got web fonts working here, see twitter icon in upper right, world icon in bottom left.

1  
2  
3  
4  
5  
6  
$mightBeIE = !$chrome && strpos($ua, 'MSIE') !== false; // Could be Opera.
if ($mightBeIE) {
   ?><style>@font-face{ font-family:icons;src:url(/html/fonts/icons/icons0.eot);src:local('☺︎'),url(/html/fonts/icons/icons0.eot?#iefix)format('embedded-opentype'),url(/html/fonts/icons/icons0.woff)format('woff'),url(/html/fonts/icons/icons0.ttf)format('truetype'),url(/html/fonts/icons/icons0.svg#icons)format('svg')}</style><?
} else {
   ?><style>@font-face{font-family:icons;src:local('☺︎'),url(/html/fonts/icons/icons0.woff)format('woff'),url(/html/fonts/icons/icons0.ttf)format('truetype'),url(/html/fonts/icons/icons0.svg?#icons)format('svg')}</style><?
}
21  Game Development / Newbie & Debugging Questions / Re: Ways of keeping track of classes... on: 2014-11-14 16:10:21
Here's a rare write up on how to properly do OOP:
http://mollyrocket.com/casey/stream_0019.html
22  Java Game APIs & Engines / OpenGL Development / Re: LWJGL 3; how's it getting along? on: 2014-11-14 16:09:09
Checked again with shift+F5, same issue.
23  Java Game APIs & Engines / OpenGL Development / Re: LWJGL 3; how's it getting along? on: 2014-11-14 15:49:20
Site looks neat! Web font doesn't work in FF 33.0.1. http://i.imgur.com/Pe6iKpq.png
24  Game Development / Newbie & Debugging Questions / Re: Ways of keeping track of classes... on: 2014-11-11 21:31:25
It's a thing in animation. Smiley
http://esotericsoftware.com/spine-animating#Straight-ahead
http://en.wikipedia.org/wiki/12_basic_principles_of_animation#Straight_Ahead_Action_and_Pose_to_Pose
25  Game Development / Newbie & Debugging Questions / Re: Ways of keeping track of classes... on: 2014-11-11 13:54:13
Packages are for organization and the default access (package private) modifier can be used to provide a non-public API across classes, but other than that packages don't mean anything.

I have always preferred the "straight ahead" approach, which is to sit down with my vague idea of what I'm building and start typing. All the code goes in a single class, using static member classes where it makes sense. As the code grows, I periodically step back to see how it is forming and refactor as needed. If the code grows too large for one file, I break it into multiple files using Refactor > Move type to new file. If the code is done before it gets too big, I still move classes into their own file if it makes sense (usually if other classes will use them or if longer than a few hundred lines).

The key to the straight ahead approach is the periodic refactoring. It also requires speed (you'll be rewriting and reorganizing a lot) and experience (starting with a decent approach to the solution, knowing what is good/bad and how to refactor). It is good because you learn to write high quality code, as long as you aren't lazy with your refactoring. It's bad because a lack of planning can take you way off into the weeds. I don't advocate not planning at all, but to plan a little and use coding to explore how the plan works out. A beginner is likely to not have a great plan no matter what, so IMO you might as well dive in and build something, then step back and adjust as needed. If you don't have the skills to assess your own code, ask others for a code review.

Ultimately design requires a lot of experience. If you lack that, you need to jump in, make mistakes, then recognize the mistakes and improve.
26  Game Development / Newbie & Debugging Questions / Re: Ways of keeping track of classes... on: 2014-11-11 01:59:44
Spine has 273 .java files with over 1100 classes. This excludes native code and all dependencies. libgdx has 517 .java files in the core project and 1910 total.

Organize only enough so your stuff makes sense. You don't need a UML diagram or a text file to keep track of things. You have the code right in front of you. If you aren't working on or with a bunch of your classes, you don't need to worry about those. When you do, review them for a refresher and then consider how you will use them.

IMO, focus more on the final product (your game) and less on how to get there. Anything the player will not notice while playing is time wasted, assuming the goal is to actually make a game.
27  Java Game APIs & Engines / OpenGL Development / Re: LWJGL 3; how's it getting along? on: 2014-11-08 19:38:20
Sounds pretty damned nice, need to find time to check it out.
28  Java Game APIs & Engines / OpenGL Development / Re: LWJGL 3; how's it getting along? on: 2014-11-08 02:44:23
How does the build work if I want to build it locally? Can I just go "ant" and have it build, including natives?
29  Discussions / General Discussions / Re: What defines a Game Library or Collection of Utilities on: 2014-11-06 18:56:42

Very hard to determine where to draw the line. I think libgdx is ok as an assortment of utilities you can choose from. If you don't care to use portions of it, you can still use it as basic, cross platform window management, input, etc.

Or we could just all go code games....?

That's just mean. You know full well some of just... can't. I can code the hell out of some tools though! Wink Plus, during a gold rush, sell pickaxes!
30  Discussions / General Discussions / Re: What defines a Game Library or Collection of Utilities on: 2014-11-06 01:04:10
matanui159, what you describe is called a scene graph. See scene2d in libgdx.

People can and will share their 6 LOC of they want. People will also make terrible libraries. It can be a learning experience for them and is not something that needs to be discouraged.

When I need a library for some task, it is a huge pain to dig through a bunch of junk, narrow it down to a handful, and try each remaining one in depth. Usually they are all pretty bad, in different ways, but sometimes I get surprised and find something that is really great. We need people to share and to try making things that are great. Some of them will succeed eventually.

For coders of all experience levels, it is very easy to look at other people's code and decide it is bad. It usually takes quite a bit of effort to understand the complexity of the problem and decide if the approach it takes to solve it is reasonable. When looking at something relatively complex, it's much easier to decide the whole thing is poorly written junk. While that is often the case, making that decision incorrectly is a big mistake.
Pages: [1] 2 3 ... 60
 

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

The first screenshot will be displayed as a thumbnail.

Archive (12 views)
2015-01-29 04:26:08

theagentd (16 views)
2015-01-28 15:33:52

GamerIDGoesHere (25 views)
2015-01-27 01:23:23

GamerIDGoesHere (25 views)
2015-01-27 01:22:15

CopyableCougar4 (34 views)
2015-01-27 00:34:41

CopyableCougar4 (20 views)
2015-01-26 04:47:56

Olo (15 views)
2015-01-25 21:26:00

Olo (18 views)
2015-01-25 18:44:22

Robo11 (36 views)
2015-01-25 06:14:26

basil_ (30 views)
2015-01-17 22:29:32
2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17
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!