Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411372 Posts in 69353 Topics- by 58405 Members - Latest Member: mazda911

April 13, 2024, 04:06:28 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
  Show Posts
Pages: 1 ... 8 9 [10] 11 12 ... 29
181  Community / Tutorials / Re: Braving Procedural Generation on: December 21, 2011, 03:13:48 AM
I think puzzle generation is less covered because simply generating good and fun puzzles is usually nearly impossible.
182  Player / General / Re: If you make games you can get with this girl on: December 20, 2011, 11:32:27 AM
God bless Finland (and some other countries too(?)), the magical country of free education.
183  Community / Creative / Re: Ideal game type to start developing? on: December 20, 2011, 10:21:42 AM
You think everyone knows linear algebra and geometrical transforms, or even derivation and integration? Smiley For even a basic realistic physical simulation and you'll need university maths
What kind of necessary math there is in universities that isn't covered at all in high school? (just curious and too lazy to check it out by myself)
184  Developer / Technical / Weird serialization problems [Java + YamlBeans] on: December 20, 2011, 03:26:42 AM


Quote from: Console
STARTING SEARCH IN /home/tapio/Gauntlet/Gauntlet/resources

Searching in path complete. Starting to parse files
Reading file /home/tapio/Gauntlet/Gauntlet/resources/pothead.yaml
Reading file
Adding animation PotheadWalkDown
Type class loading.AnimationInfo
Adding animation PotheadWalkUp
Type class loading.AnimationInfo
Adding animation PotheadWalkLeft
Type class loading.AnimationInfo
Adding animation PotheadWalkRight
Type class loading.AnimationInfo
com.esotericsoftware.yamlbeans.YamlReader$YamlReaderException: Line 40, column 9: Error creating object.
   at com.esotericsoftware.yamlbeans.YamlReader.readValueInternal(YamlReader.java:270)
   at com.esotericsoftware.yamlbeans.YamlReader.readValue(YamlReader.java:156)
   at com.esotericsoftware.yamlbeans.YamlReader.readValueInternal(YamlReader.java:299)
   at com.esotericsoftware.yamlbeans.YamlReader.readValue(YamlReader.java:156)
   at com.esotericsoftware.yamlbeans.YamlReader.read(YamlReader.java:106)
   at com.esotericsoftware.yamlbeans.YamlReader.read(YamlReader.java:91)
   at com.esotericsoftware.yamlbeans.YamlReader.read(YamlReader.java:83)
   at resources.Loader.loadFromFolder(Loader.java:65)
   at game.Game.init(Game.java:62)
   at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:390)
   at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:314)
   at game.Game.main(Game.java:36)
Caused by: java.lang.reflect.InvocationTargetException: Unable to find a no-arg constructor for class: [F
   at com.esotericsoftware.yamlbeans.Beans.createObject(Beans.java:113)
   at com.esotericsoftware.yamlbeans.YamlReader.createObject(YamlReader.java:368)
   at com.esotericsoftware.yamlbeans.YamlReader.readValueInternal(YamlReader.java:268)
   ... 11 more
I got this weird problem that shouldn't (I think) exist. I have 3 similar classes: AnimationInfo, EntityInfo and StateInfo.
They all have similar no-arg constructors but it refuses to work. AnimationInfo deserializes just fine, but EntityInfo doesn't.

Here's the classes as they are now
Code:
package loading;

import org.newdawn.slick.Color;

public class AnimationInfo{


public AnimationInfo() {
super();
this.name = null;
this.filename = null;
this.frames = null;
this.durations = null;
this.spriteW = 0;
this.spriteH = 0;
this.transparentcolor = null;
}

public AnimationInfo(String name, String filename, String row,
int[] frames, int[] durations, int spriteW, int spriteH) {
super();
this.name = name;
this.filename = filename;
this.frames = frames;
this.durations = durations;
this.spriteW = spriteW;
this.spriteH = spriteH;
}

public String name; //Name/Id of the animation
public String filename; //Where to load the spritesheet
public int[] frames; //How many frames that animation has
public int[] durations; //Duration of each frame in msecs
public int spriteW; //Width
public int spriteH; //Height of each frame
public int[] transparentcolor;
}
Code:
package loading;

import java.util.HashMap;

import org.newdawn.slick.geom.Rectangle;
import org.newdawn.slick.geom.Vector2f;

import core.Entity;
import core.KeyCharacterController;

public class EntityInfo {

public EntityInfo(){
EntityID = null;
hitbox = null;
height = 0;
zValue = 0;
states = null;
}


public EntityInfo(String entityID, float[] hitbox, float height, float zValue, StateInfo[] states) {
super();
EntityID = entityID;
this.hitbox = hitbox;
this.height = height;
this.zValue = zValue;
this.states = states;
}


public String EntityID;
public float[] hitbox; //Length is 4
public float height;
public float zValue = 0;
public StateInfo[] states;
/**
* It'll looks like this in yaml
* states:
*   - !loading.StateInfo
*     - UpdateComponents
*       - Data
*     - RenderComponents
*       - Data
*/

public static HashMap<String, EntityInfo> store = new HashMap<String,EntityInfo>();
}
And here's the .yaml-file
Code:
!loading.AnimationInfo
name: PotheadWalkDown
filename: "sprites/pothead.png"
spriteW: 16
spriteH: 21
frames: [0,0,0,1,0,2,0,1]
durations: [200,200,200,200]
transparentcolor: [255,255,255]
---
!loading.AnimationInfo
name: PotheadWalkUp
filename: "sprites/pothead.png"
spriteW: 16
spriteH: 21
frames: [3,0,3,1,3,2,3,1]
durations: [200,200,200,200]
transparentcolor: [255,255,255]
---
!loading.AnimationInfo
name: PotheadWalkLeft
filename: "sprites/pothead.png"
spriteW: 16
spriteH: 21
frames: [1,0,1,1,1,2,1,1]
durations: [200,200,200,200]
transparentcolor: [255,255,255]
---
!loading.AnimationInfo
name: PotheadWalkRight
filename: "sprites/pothead.png"
spriteW: 16
spriteH: 21
frames: [2,0,2,1,2,2,2,1]
durations: [200,200,200,200]
transparentcolor: [255,255,255]
---
!loading.EntityInfo
EntityID: Pothead
hitbox: {-10,-10,20,20}
height: 30.0
zValue: 0
states:
 - !loading.StateInfo
   stateName: "moving"
   updateComponents:
     - "core.states.BehaviorMoving"
   updateArgs:
     - ["20"]
   renderComponents:
     - "core.states.RendererMoving"
   renderArgs:
     - ["PotheadWalk","PotheadRight","PotheadLeft","PotheadRight"]
 ---
 

Yes it is a huge wall of text. I just couldn't describe it with less space.
185  Player / General / Re: Something you JUST did thread on: December 20, 2011, 02:26:11 AM
IT'S THE BEST SITE 4EVAR!
186  Player / General / Re: If you make games you can get with this girl on: December 19, 2011, 11:22:31 PM
There's a place specialized in game development here in Finland http://kajak3d.com/index.php?page=index_en
Useful or useless like they usually are?
187  Player / Games / Re: Skyward Sword on: December 19, 2011, 10:01:23 AM
Sleep in Beedle's shop.
188  Player / Games / Re: Skyward Sword on: December 19, 2011, 06:32:10 AM
Who tried the boss rush ?

I was kinda disappointed that I could get Hylian shield on the first try.
189  Developer / Design / Re: RPGs not based on fighting on: December 19, 2011, 01:49:43 AM
How about an RPG where "battles" are social conversations?
That would probably allow more puzzle based encounters, where you have some objectives, like getting some information out of opponent, or something like that.
190  Community / Creative / Re: Best approach to finding alpha & beta testers on: December 17, 2011, 01:20:11 PM
Oh I thought you knew that TIGF is full of old cranky gentlemen who won't touch anything that looks like some other game. Unless we are talking about Cave Story clones. Everyone loves CS. True story. Period. Sheesh.
191  Community / Creative / Re: TIGsource Advent Calendar on: December 16, 2011, 07:28:19 AM
Someone should make video previews of every game.
I am not that someone.
192  Player / Games / Re: Skyward Sword on: December 13, 2011, 06:29:29 AM
Completed the game and started heromode.
I'm also planning to make a vid about completing last boss in hero mode without shield and any pouch items.
Doable? I'll see that later.
193  Developer / Technical / Re: Learning Java Programming for 2D platform games? on: December 13, 2011, 06:19:00 AM
<Slightly OT>

"When you know what you're doing it doesn't matter what language you use". That is a Turing Tarpit argument: all languages are Turing-complete so you CAN do anything in any language. However, that doesn't mean that all languages are equally siutable for all tasks. I think the important part here is "when you know what you're doing", and to reach the level of the Jpcsp devs might take a fair time.

The reasons I advice against Java for games are not because the language is incompetent (as languge warriors of any side usually does) but principally because (1) it's relative lack of resources and help compared to game development in f.i. Python, C, or C++; (2) for beginners it has a lot of "don't ask why it is like that and just accept it" quirks; and as I said before (3) it teaches you bad habits that makes moving to other languages more painful.

</OT>
I do currently some java programming, and I'm interested what those quirks and bad habits are. A "short" list, please?
194  Jobs / Collaborations / Re: Artist/animator with game idea looking for an awesome programmer on: December 12, 2011, 04:39:34 AM
My first reaction was "What, Edmund McMillen is working on something new?"

Cool stuff tho'
195  Community / Jams & Events / Re: Medival Sp and Mp game recruting animators and texture er on: December 11, 2011, 11:30:54 AM
 Derp Huh?
Wrong subforum.
196  Community / Tutorials / Re: Game Maker Tuts on: December 10, 2011, 08:08:17 AM
It happens because you are only checking one instance! Instead you should iterate through all instances(with is perfect for this)

Here's a working(?) piece of code:
Code:
with(obj_arrow_down)
{
  if(x == other.x && y == other.y){ //other refers to ship not arrow
    direction = 270
    image_angle = 270
  }
}
And repeat that for each arrow type
197  Developer / Technical / Re: Learning Java Programming for 2D platform games? on: December 09, 2011, 11:47:00 AM
In that you can run Java source code in Scala ( like you can run most C code in C++ ) and Scala code can run in the JavaVM.  It adds functional programming, dynamic types and other features on top of what Java can already do.  In essence, Scale brings Java up to parity withw C#.
I'd say word source is wrong here. Scala can use all the classes java can and classes written in Java.

Also, language feats is not that good reason. You could type almost the same code in C# for example, which has more features(i think?). Jvm just is so useful.
But anyway, Java is a good choice for starters. And most of those programming skills translate to other languages.
198  Community / DevLogs / Re: Hellas - greek vase platform prototype v5 on: December 08, 2011, 08:09:06 AM
Please remember that local multiplayer is almost always more fun than online. Especially in this case.
199  Developer / Workshop / Re: Let's Workshop With Jotapeh on: December 07, 2011, 12:08:05 AM
This thread reminds me of my own fooling around times with blender.
200  Player / Games / Re: Skyward Sword on: December 04, 2011, 11:52:12 AM
Wait, is there any side quest where only prize/benefit is gratitude crystals? I haven't stumbled at least yet on any of those.
Pages: 1 ... 8 9 [10] 11 12 ... 29
Theme orange-lt created by panic