Java-Gaming.org Hi !
 Featured games (84) games approved by the League of Dukes Games in Showcase (603) Games in Android Showcase (171) games submitted by our members Games in WIP (652) games currently in development
 News: Read the Java Gaming Resources, or peek at the official Java tutorials
 Show Posts Pages: [1] 2 3 4
 1 Game Development / Game Mechanics / Re: Working on an isometric engine - Need help with movement design on: 2011-01-25 08:41:16 as Eli said.I struggled for a while having my logic work in the isometric perspective. I have another thread open at the moment with what Ive learned. doing all the movement login in cartesian world-space and then transforming to isometric screen space is the way to go I think.
 2 Game Development / Game Mechanics / Re: Translating between cartesian and Isometric coordinates on: 2011-01-21 10:52:51 Hi,Glad that the forums are back Yes, I realised that most of the processor heavy stuff actualy is constant, so I pre-calculate that, store it as a variable, and use it each time. This is WAYY quicker, obviously I dont have my code with me at the moment, but I will post the method I'm now using along with some screens later this evening. What I'm going to work on next is getting a basic particle system going.The next problem I need to solve is automaticaly finding the center point of the base of a sprite.
3  Game Development / Game Mechanics / Translating between cartesian and Isometric coordinates on: 2011-01-14 10:33:31
Morning all.

my for-fun project at the moment is a basic isomorphic base building tower defense strategy game.

I need to be able to translate between my easy to use 3D Cartesian world system to my 2D Isometric screen projection.

I thought I would create a thread on this, to document my progress and get a bit of discussion going.

UPDATE:

My world cord system will use 3D XYZ coordinates. I need to convert this to the 2D XY cord system that the screen uses to draw.
The goal is to be able to then draw my 3D world in 2D Isometric projection.

I started by Wikipedia-ing that: http://en.wikipedia.org/wiki/Isometric_Projection

The first important point I noticed it that I've got the camera angles wrong on my sprite renders

From this I was able to sketch up the following function for transforming from world to screen cords.

 1  2  3  4  5  6  7  8  9  10  11  12 `Vector2 cameraOffset;// these could probably be a constant.  float a = arctan(1/2); float s = 100f; // the edge-width of one cubic cell in the world.Vector2 World2Screen(float X, float Y, float Z){   float screenX = cameraOffset.X + (X-Z)cos(a)s;   float screenY = cameraOffset.Y + ((X+Z)sin(a)-Y)s;   return new Vector2(screenX, screenY);}`

I've not had a chance to run this code yet, but any comments, suggestions and constructive crit' are welcome.

Thanks for reading, have a good day,
Matt
 4 Java Game APIs & Engines / Engines, Libraries and Tools / Re: Sprite Alpha. What am I doing wrong? on: 2011-01-14 01:59:09 Hah, I found out why I'm having troubble removing the pink in Photoshop. When the oclusion renders, it includes 10% of the (pink) background into the resulting color - which is why I cant get rid of the damn stuff without loosing my other colors Cool, I can now manualy remove the pink mask in PS while keeping my shadows.
 6 Java Game APIs & Engines / Engines, Libraries and Tools / Sprite Alpha. What am I doing wrong? on: 2011-01-13 22:59:30 Hi all,Im taking a break from XNA (booo) Uni work to do some more Java Gaming.I'm trying to make a isomorphic turret-defence using Slick2D and I think that I may have just kneecapped myself while making my Sprites. I spent 2 days doing these, so I hope i'm wrong Now, in XNA, and I was sure in Java2D, you can say that a color, say Color(255,45,255), is a chroma-key mask color, and anything with that will get removed. So, I went ahead and made a load of sprites like this:Now that i've modeled and rendered all these things, I downloaded slick again and got going ... only to not be able to find a way of doing the above.I realy dont want to re-render all of these things What am I doing wrong here?Thanks guys,Matt
 7 Game Development / Game Mechanics / Re: How are Procedural Textures made? on: 2010-10-21 15:36:11 Thanks for the links guys!I spent this morning reading about Perlin and Simplex noise, and I think that I may be able to use these (and modifications thereof) to make the type of textures we are looking for. When I start on the actual development of these, I'll create a thread with my notes.Genetica looks really cool I wish I had the time and patience to get back into modeling/texturing. In a few weeks I will be beginning a 3DS Max course at Uni, and I will definitely have a play around with demo version of Genetica to see what it can do.
 8 Game Development / Game Mechanics / How are Procedural Textures made? on: 2010-10-20 22:09:03 Hi guys, This year at Uni my group's been tasked with creating a game to advertise how super-cool-fun the games and entertainment systems department is.What they're expecting is like a side-stroller or zelda clone something, but we've been given free reign to do whatever we like as long as its a 2D 'shooter' style thing.We've been discussing some ideas based around procedurally generated worlds, with the idea of having a 'massive game world' for the players to explore. There will be some aspect of questing (eg, go here, kill that, find this, save the npc, etc) on top of this.What I'm researching at the moment is how feasible it will be to use procedurally generated textures (turbulence, veins, noise, and such) as part of our level generation.For example, say we need a forest with loads of paths - i use a 'veins' type of texture (i think there's one in most 3D graphics packages) as the map for the tree density, so we get a load of trees with paths in between them.Does anyone have any experience of using this approach to generate levels? I have done some experiments with this (see this post) in the past using bitmap images as my map.How exactly are procedurally generated textures actually generated? Are there a set of well known equations or is it more of an art?
 9 Discussions / General Discussions / Re: Gaming Habits Research Mini-Project on: 2010-10-16 21:38:55 Hah, that was a typo.I'll fix that before anyone's brains boil out  EDIT: Fixed.
 10 Discussions / General Discussions / Gaming Habits Research Mini-Project on: 2010-10-16 11:40:55 Hi All,As part of our undergraduate project this year at university, we've been set a really vague brief to 'Make a Game'. We want to better understand what the 'average' gamer in 2010 is like, and work from there, so I've set up a quick, anonymous 20-questions quiz. If you could spend 2 minutes completing it we would be very grateful.  When we have finished collecting results, I'll make them available here.The Quiz!Thanks for your time,Matt
 11 Games Center / Archived Projects / Re: Bubble Squids on: 2010-08-28 11:14:30 Hehe, it's strangely compelling to play. When I started I was thinking.. ok, its a bit simple, I'm not going to be playing this for more than a minute, and 10 minutes later I was still at it Once I got my head around the scoring system, I was able to get into scoring more points per squid, and that made the game more interesting.Ditto on the time limit thing. While having a time limit adds pace, I think that it would be to frustrating for a kid to do.Unfortunately I have no kids available to test this on for you, but it did take me back to the old maths and spelling games on the BBC Basics at school.Nice job
 12 Games Center / Showcase / Re: Dude, that's my bullet - Ludum dare 18 jam on: 2010-08-28 11:01:29 Cool, very fun. I found it a bit too challenging after level 5 though, but that kept me playing, determined to beat it.
 13 Games Center / Archived Projects / Re: Gunslinger 2 - sci-fi action top down shooter on: 2010-08-28 07:40:13 Hi,Just wanted to say that from the videos the graphics are nice and polished, and the gameplay looks good.However, I tried running it on my dad's old dell inspiron 1525 running Vista, and the webstart fails. That said, it is not my laptop, so my old man may have blocked/uninstalled JVM for all I know
 14 Games Center / Archived Projects / Re: JOURNAL: Space Fleet Combat (now less of a 2D Game Engine) on: 2010-08-28 07:26:29 Hay all,Just to let you know me and the project are still alive. The project is on hold for a few weeks while I take a break and work on some research stuff.This is usualy how I roll, so expect another gaming binge in a while!
 15 Game Development / Newbie & Debugging Questions / Mobile code editors - help me not escape from work! on: 2010-08-16 10:04:56 mornin' all,I'm sitting in the bar at work thinking that I do most of my best thinking while sitting in the bar or on the train or out in the wilderness wrestling bears, and never when I'm actualy sat at  my desk.what I'm thinking about right now is: what would it take to klein a basiccode editor that will run on my HTC (or the java enabled smart phone of your preference)?is there an easy and convinient way to get thefile paths and class names from the classpath and display them as a tree?what about code highlighting?is a smart phone man enough to run code-completion and scan for errors?has all this been done before?your thoughts, ladies and gentelmen.
 16 Game Development / Newbie & Debugging Questions / Re: Quick! Is there a Mathematician in the house?! on: 2010-08-07 00:17:08 Hay, I got it working! Now I can get back to actual real programming  I feel really stupid asking this, but can anyone explain to me why raising to a power of an even number always returns a positive, and raising to the power of a odd number will do both positive and negative?thanks for the graphing tip, I'm giving jFreeChart a go.
 17 Game Development / Newbie & Debugging Questions / Re: Quick! Is there a Mathematician in the house?! on: 2010-08-06 18:24:06 Ahh, cool, that's actually a really useful thing to know Cheers.I did want to go down the Excel rout with this (for the graphing functions), but I may just write a program that dumps out the CSV's instead...THis is getting further off topic, but has anyone found a really simple graphing package for java and swing? I cant remember which ones i've tried, but I've never found one that works, or is far too complicated and finiky to use for me to bother trying
18  Game Development / Newbie & Debugging Questions / Re: Quick! Is there a Mathematician in the house?! on: 2010-08-06 08:52:19
Alternatively, if you don't need the linear ramp:
 1  2  3 `double highNumber = 500; // seems to give good resultsdouble oddNumber = highNumber | 1; // otherwise you might end up without negative valuesMath.pow(Math.sin(angle), oddNumber);`

I think this is what I need.

I actually need to do this bit of code as an Excel formula rather than java code, to them save out as a CSV file and use with my program. I can sort that out though, its just the math that gets me

Thanks guys!

EDIT:
 1 `double oddNumber = highNumber | 1; // otherwise you might end up without negative values`

what does this line actually do? I've not come across inclusive OR before. (and I'm not getting any negative values)

EDITEDIT:

http://support.microsoft.com/kb/q132686/ Microsoft has no need for your primitive BODMAS! Blah!
 19 Game Development / Newbie & Debugging Questions / Quick! Is there a Mathematician in the house?! on: 2010-08-05 16:48:48 I've always wanted to say that...This is slightly off topic, but still part of my Java project work, so I thought there might be someone here that can help me. I'm working on a neural network project, and what i need to do is take the following sin wave (in black) and create the red line, which is the ideal output of the network.Currently I've been doing this manually in Excel, because i have no idea how to calculate this. Basically, when the angle is at the 90 degree position, the output needs to be 1, and at the 270 degree position, it needs to be -1, and anywhere else it needs to be as close to zero as possible.I probably wouldn't be the first to say I'm terrible with Trig' Thanks all,Matt
 20 Games Center / Archived Projects / Re: JOURNAL: Space Fleet Combat (now less of a 2D Game Engine) on: 2010-07-25 19:33:18 Quote from: h3ckboy on 2010-07-24 10:58:441. u learna  whole lot doing ityeh, that's exactly my reasoning.
 21 Game Development / Newbie & Debugging Questions / Re: Applet Image Loading on: 2010-07-25 13:31:16 Quote from: zoto on 2010-07-25 08:34:51I believe applets have 64MB of ram by default and can only be changed client side...I did not know that. Useful to know though, I think you may just have saved me days of 'why, WHY is it not working!?' time in a few months
 22 Game Development / Newbie & Debugging Questions / Re: Applet Image Loading on: 2010-07-24 16:16:15 Ahh, that looks cool Zoto, I'll give it a go.The method I've been using is to load everything into a HashTable at start up, instead of loading on demand, which is what your code does. Do you know if there is any advantage to either solution?
24  Games Center / Archived Projects / Re: JOURNAL: Space Fleet Combat (now less of a 2D Game Engine) on: 2010-07-24 08:22:13
No great experiments today, just going back to updating my empty template game to use SLick2D's StateBasedGame, with a short animated introduction state and sound.

After some discussion on the forums and some reading around, I'm re-writing my content loading code to use the ClassLoader class, and storing all my content in the classpath.

My overall goal for today is to consolidate everything I have into something reusable. Until now I have been copy-pasting bits from other projects here and there as I need them. This has lead to the obvious problem of having 30 copies of the same class on my HDD, one of which is the RIGHT one

At the moment, my classpath looks like this:

 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24 `TemplateSlickGame (used to create a new game project in NetBeans)  assets    art                          (for storing images)      sound              (for storing sounds & music)      effects              (currently only for storing particle effects)  slickgametemplate    Main (main class for the app)    SlickGame (extends StateBasedGame)    RBGWIntroState (extends GameState to show a splash screen)rbgwLib (code library common to all my games)  content    ResourceManager          (loads and indexes art, music, particle effects, etc)    IResourceLoader          (an interface for loading resources)      loaders        ImageLoader        (loads images)        SoundLoader        (loads sounds/music)        FontLoader        (loads Slick Font types)        ParticleLoader        (loads particle systems)        AnimationLoader        (loads Slick Animations)                  TODO: Move the rest of my crappy-hacked code into this library :)`

Probably not allot of scope for screen shots today...
 25 Discussions / General Discussions / Re: Starcraft 2 cost \$100 million to make! on: 2010-07-23 20:02:31 well I'm paying myself \$40M a year in IOU's, so I think that I can beat that...... Minesweeper 2 - \$150 Million in the making.
 26 Game Development / Newbie & Debugging Questions / Re: Applet Image Loading on: 2010-07-23 18:56:21 Thanks ryanm! Loading images this way seems to be working now, and I've set-up my game template project to include an assets.art, assets.data, assets.art.sound and assets.art.music class-path, and also a template resources.xml document to load in some default images.I've used this to move my template project over to using Slick's StateBasedGame class and added an Intro state that show's my (WIP) blog-site logo with a nice fade-in fade-out effect  I actually feel like I've got something done today.
 27 Game Development / Newbie & Debugging Questions / Re: Applet Image Loading on: 2010-07-23 15:31:13 ok, i'll have a read-up on those.Would it be better to continue using my hash-tables to store my resources in memory, or to change them to using something like HashTable and using getResource(path) each time I want to get a resource? (I assume this would then either load the file from the classpath, or try findLoadedClass() first to get it from the cache, right?)
28  Game Development / Newbie & Debugging Questions / Re: Applet Image Loading on: 2010-07-22 15:40:16
Hi,

I've had a go at modifying my resource manager class to use ClassLoader (rather than fileIo). I'm having a lot of trouble understanding how this is meant to work. Does anyone know of any basic tutorials that cover loading files this way? Everything I've been able to find seems to only work with actual classes.

Here's the code I have tried for reference:
 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57  58  59  60  61  62  63  64  65  66  67  68  69  70  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87  88  89  90  91  92  93  94  95  96  97  98  99  100  101  102  103  104  105  106  107  108  109  110  111  112  113  114  115  116  117  118  119  120  121  122  123  124  125  126 `public class ResourceManager {   private static ResourceManager _instance = new ResourceManager();        private static ClassLoader classLoader;   private Map soundMap;   private Map imageMap;   private Map animationMap;   private Map textMap;        private Map particleMap;   private ResourceManager() {      soundMap = new HashMap();      imageMap = new HashMap();      animationMap = new HashMap();      textMap = new HashMap();                particleMap = new HashMap();                classLoader = ClassLoader.getSystemClassLoader();                try                {                    /* NTS:                     * Modifying this class to load resources from the classPath                     * so that it can be used within applets.                     * 22 July 2010, Matt                     */                    URL url = classLoader.getResource("assets/data/resources");                    if(url != null)                    {                        File f = new File(url.getPath());                        this.loadResources(new FileInputStream(f));                    }                    else                    {                        throw new NullPointerException();                    }                }                catch(SlickException e)                {                    e.printStackTrace();                }                catch(FileNotFoundException e)                {                    e.printStackTrace();                }   }   public final static ResourceManager getInstance(){      return _instance;   }   public void loadResources(InputStream is) throws SlickException {      loadResources(is, false);   }   public void loadResources(InputStream is, boolean deferred) throws SlickException        {            DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();            DocumentBuilder docBuilder = null;            try            {                docBuilder = docBuilderFactory.newDocumentBuilder();            }            catch (ParserConfigurationException e)            {                throw new SlickException("Could not load resources", e);            }            Document doc = null;            try            {                doc = docBuilder.parse (is);            }            catch(SAXException e)            {                throw new SlickException("Could not load resources", e);            }            catch (IOException e)            {                throw new SlickException("Could not load resources", e);            }      // normalize text representation            doc.getDocumentElement ().normalize ();            NodeList listResources = doc.getElementsByTagName("resource");            int totalResources = listResources.getLength();            if(deferred)            {           LoadingList.setDeferredLoading(true);            }            for(int resourceIdx = 0; resourceIdx < totalResources; resourceIdx++)            {           Node resourceNode = listResources.item(resourceIdx);           if(resourceNode.getNodeType() == Node.ELEMENT_NODE){                    Element resourceElement = (Element)resourceNode;                    String type = resourceElement.getAttribute("type");                    if(type.equals("image")){                            addElementAsImage(resourceElement);                    }else if(type.equals("sound")){                            //addElementAsSound(resourceElement);                    }else if(type.equals("text")){                            //addElementAsText(resourceElement);                    }else if(type.equals("font")){                    }else if(type.equals("animation")){                           // addElementAsAnimation(resourceElement);                    }                    else if(type.equals("particleSystem")){                            addElementAsParticleSystem(resourceElement);                    }           }            }   }       ... loads of methods for getting the files from the XML nodes ...`

Where I'm having trouble is here:
 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15 `                     /* NTS:                     * Modifying this class to load resources from the classPath                     * so that it can be used within applets.                     * 22 July 2010, Matt                     */                    URL url = classLoader.getResource("assets/data/resources.xml");                    if(url != null)                    {                        File f = new File(url.getPath());                        this.loadResources(new FileInputStream(f));                    }                     else                    {                        throw new NullPointerException();                    }`

Which always throws the nullPopinterException with 'url' always returning null.

This is all rater new to me, so thanks for being patient
 29 Game Development / Newbie & Debugging Questions / Re: Applet Image Loading on: 2010-07-21 17:25:56 Ok, I'll give that a go.Is it possible in NetBeans to include folders and images into the class path, or only java class files?Just now I'm adding them in after build with 7-zip ... which I guess is a bit silly.
30  Game Development / Newbie & Debugging Questions / Applet Image Loading on: 2010-07-21 16:25:58
What is the best way to load images and XML data to a java applet?

What I have at the moment is an Slick2D Game applet. I have a content loader from an application project that takes an XML file containing links to the games separate image/sound/particles, etc that need to be loaded.

Finally I have a directory called 'art' that contains the actual image files.

On my server I have kept the same directory structure as the application version:

MyApplet
- data
- resources.xml
- art
- image1.png
- image2.png
- image3.png
- image4.png

When running the applet, I get the following error:

 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15 `Exception in thread "Thread-14" java.lang.ExceptionInInitializerError   at DecoGame_NixieClock.NixieClockGame.init(NixieClockGame.java:43)   at org.newdawn.slick.AppletGameContainer\$Container.initApplet(AppletGameContainer.java:272)   at org.newdawn.slick.AppletGameContainer\$ContainerPanel.initGL(AppletGameContainer.java:229)   at org.newdawn.slick.AppletGameContainer\$ContainerPanel.start(AppletGameContainer.java:216)   at org.newdawn.slick.AppletGameContainer\$1.run(AppletGameContainer.java:92)Caused by: java.security.AccessControlException: access denied (java.io.FilePermission data\resources.xml read)   at java.security.AccessControlContext.checkPermission(Unknown Source)   at java.security.AccessController.checkPermission(Unknown Source)   at java.lang.SecurityManager.checkPermission(Unknown Source)   at java.lang.SecurityManager.checkRead(Unknown Source)   at java.io.FileInputStream.(Unknown Source)   at Content.ResourceManager.(ResourceManager.java:50)   at Content.ResourceManager.(ResourceManager.java:33)   ... 5 more`

If I'm right, this is because applets are not allowed to access the local file-system.
Is there a method for loading data to an applet from the server?

This is the layout of the XML file I use to store my content links:
 1  2  3  4  5  6  7  8  9  10 `    art\image1.png  art\image2.png  art\image3.png`

Would it just be a matter of changing these links to say 'www.mydomain.com/applet/art/image1.png' or is there a better way?
 Pages: [1] 2 3 4
 SHC (21 views) 2015-08-01 03:58:20 Jesse (19 views) 2015-07-29 04:35:27 Riven (39 views) 2015-07-27 16:38:00 Riven (21 views) 2015-07-27 15:35:20 Riven (24 views) 2015-07-27 12:26:13 Riven (14 views) 2015-07-27 12:23:39 BurntPizza (35 views) 2015-07-25 00:14:37 BurntPizza (46 views) 2015-07-24 22:06:39 BurntPizza (28 views) 2015-07-24 06:06:53 NoxInc (36 views) 2015-07-22 22:16:53
 theagentd 51x wessles 45x basil_ 35x KaiHH 26x orangepascal 26x ags1 21x Riven 19x mooman219 17x bornander 14x KudoDEV 13x CelestialCreator 11x princec 11x klaus 11x Jesse 11x pquiring 9x Zaneris 9x
 List of Learning Resourcesby gouessej2015-07-09 11:29:36How Do I Expand My Game?by bashfrog2015-06-14 11:34:43List of Learning Resources2015-05-31 05:37:30Intersection Methodsby Roquen2015-05-29 08:19:33List of Learning Resources2015-05-05 10:20:32How to: JGO Wikiby Mac702015-02-17 20:56:162D Dynamic Lighting2015-01-01 20:25:42How do I start Java Game Development?by gouessej2014-12-27 19:41:21
 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