Hello all, I've been working on this problem off and on for the past few months and haven't been able to figure it out. Basically, I am trying to create a bufferedimage out of a byte[][] array and a IndexColorModel palette, and have no clue how to go about doing it. Currently, this is the code I have, but it doesn't work whatsoever.

Hey guys, I've recently started learning about XML and all the other hordes of file types associated with it. However, I'm having trouble finding info about how to actually use validated XML files within my game.

For example, I know how to extract element names using both SAX and DOM, but all this leaves me with is a bunch of Strings and if statements. Instead, is it possible for the document to actually read the XSD file and extract the file types of the attributes? So that everything isn't CDATA?

Unfortunately, I have just realized that the way I actually read the contents of the folder no longer works when the resources are packaged into a jar. Before, I would open up a URLConnection on a URL, then read all of the filenames in the folder using a BufferedReader. However, inside a jar, the following method is not able to obtain the folder as a URL.

Hey guys, I'm trying to build a framework that will allow a user to navigate the contents of a signed jar file, and need it to support looking into various subdirectories. How would one go about figuring out whether or not a given resource is a directory?

I'm getting the initial directory using MapSelection.getClass().getResource("/CremelianWars/Maps/") which returns a URL. The File class has a method for checking if it's a directory or not, but a URL doesn't seem to have one.

Yup, heckboy's got it. I've already made some plans with a friend of mine to host it on his site, so that should happen in the next couple of days. Interesting link, though. Is that what you use for your games?

@TheAnalogKidThanks for testing. I've added in a loading screen for the game, so it hopefully won't seem laggy now. These extra game repaints make the loading longer, since that's done in a seperate thread now, but the graphic will hopefully make up for it.

I have considered an isometric view, but it is already proving to be exceedingly difficult to create 2d graphics, so I would image that 2.5d would be even harder.

Interesting point about the gameplay. Theres more at work than simply that, so I may need to give more instruction on the finer points of battle. Of course, they will all boil down to one unit killing another, but some things to consider would be terrain benefits, such as standing on a mountain rather than on grass, and the ranges of the two units in the battle. If you attack a flame thrower unit from two spaces away, you will be able to shoot without fear of retaliation.

Hopefully, once I finish the base AI, managing buildings and building the units themselves will add even more depth.

The game is pretty good so far. I've done a couple of levels, and am planning on completing the whole thing, but I would just like a bit more clarification on a couple of things I thought weren't completely addressed. First off, is there a keyboard key for dropping the block? This part might have been in the directions, but I accidently skipped through some instruction and had no way of replaying it. It seems like there should be, since the drop button is very inconvenient to use.

The only other problem I ran into was learning how to switch tools. I'm posting this while playing the tree level and the game automatically provides the block mover tool. This seems handy, but I was unable to win because I had one block out of place, and moving it around didn't solve anything.

Also, is there a way to store blocks for later use? This functionality might be removed from the level I'm on, but it seems like something that should always be present.

One thing that really jumped out at me is the smoothness of the overall design, especially the way the game handles transitions and such. The textures, backgrounds, and sound effects you used were pretty good. The only thing I would chane regarding these aspects is the initial spiraling background, which made me a bit nauseous. If you were to slow the rotation down a bit, I bet it’d be a lot more complimentary, rather than detrimental to the over all effect.

Hey guys, I've been wanting to incorporate more animation into my game, but I can't really figure out a good method of doing so. As of now, I break up single .png images into smaller components, and then use those, but this method requires pixel-perfect alignment to work, which is a very tedious process. This also makes it difficult to perfectly line up the sprites, especially for a quick demo.

Basically, the question boils down to:What system do you guys use of loading and breaking up 2d frame by frame sprites into various components, and how would one do so without extensive pixel alignment?

Count me in. I agree that it is hard to find someone who will go into enough detail when providing feedback, so this seems like a great idea to get a proper response. And considering that we're both game designers, this feedback will be even more relevant.

Hey guys, here is Cremelian Wars X. It's a turn based strategy game that was inspired by both advanced wars and starcraft, and attempts to mix some elements from both games.

This game basically revolves around managing your units in order to deal the most damage to your opponent. It features over 20 unit types, scriptable game play, a fully functional game editor, a custom sound track, and traditional pixel art!

--I've been working on this game on and off for more than a year in my free time, and am happy to say that's in the final stages of development (i.e. content generation). If you have any comments about the gameplay, or anything else in general, I'd love to hear what you think.

Hi guys, I've recently had the opportunity to work on this again, and have put in a couple of new features that I'd like you to try out.

First off is the menu system, which is shown when you aren't playing a game. It has three options, play the campaign, play custom maps, and input map data. Here's how they work. The campaign option leads you on five different missions that are supposed to take place one after another. I've disabled victory so that you can try out the custom maps, so this option does not work as of now.

The next and most important part of the menu is the custom map design, which works by taking in the name of the map and loading it. The following maps have been made and are playable:custom.maplevel[1-5].map (ie level2.map etc)versus[1-2].map (You can build on these!)

The last option on the menu is where you input map data, which allows you to resume a game that you didn't have time to finish. While playing, press 's' to open up a dialogue box with the map data for the current map you're playing. You can them copy and save this code somewhere, and paste it into the load map data option when you want to resume playing. This should recreate the map you were playing perfectly. If it doesn't, paste the map code here and I'll try to correct the problem.

I hope you guys try out this version! (ARG dang broken message posting... makes it impossible to type out a message longer than this

I've never actually gotten any .mp3s to play, since java raises a security exception when running in an ide, and has never successfully loaded any in a signed applet, but I assume the JLayer package is working like it should.The main runner file is called CremelianWarsDemoMap, and it tries to pass the song names on line 98 to a class called MP3, which is located in the ResourceManagement folder, during init().

Thanks for your help. Anyone else is free to take a look if they want, too.

Time for an update. I spent most of today working on this, and have a couple of things to show for it. First off, there is finally someone to do the pixel art, which is a big plus. Secondly, the game loads a bit faster, and any additional levels that are loaded after the first should now be able to take advantage of the resources used in the last map to furthur decrease the map loading time.

Some basic scripting has also been implemented. This part is fairly exciting, since doing a good job on the scripting, and eventually releasing a map editor, can allow a game to really thrive. The scripting engine is based around triggers, which will execute all their actions(commands) if all the preconditions are first met.

These conditions have been coded:Always, Never, Accumulate, Bring, and Control.Which can impact the map in the follow ways:Defeat, Draw, Victory, Preserve Trigger, and Resource Modification.

The .html file was on the desktop, as well as the JLayer jar. However, when I deleted the JLayer package off the desktop, the error remained the same. I'm not sure what you want to know from the contents of the CremelianWars.jar file, but it contains all the necessary graphics, classes, and files to run the game, which are all subdivided into folders. The JLayer jar was placed inside a folder called ResourceManagement. You could extract the contents and take a look if you want.

@MickelukasThanks for testing! I'm relieved that the fps is a lot higher than the 8 fps I'm used to.There are plans on getting this game set up on its own website, but there isn't much of a need for that until we implement multiplayer capability.

@appelDoes the screenshot simply not load, or is it resized? Regardless, you could see how the game looks like by just running it. It takes about 5 seconds to load the game from start up.

Here is Cremelian Wars X, a turn based strategy game that puts you right in the action as you command and grow your army to defeat all that oppose you. This game features over 20 unit types, scriptable game play, a fully functional game editor, a custom sound track, and traditional pixel art!

If you download, please post what your first impressions were, as well as the fps, ups, and any errors you might have encountered. Suggestions about how to improve this game and make it more fun are always welcome, too.Thanks

(PS, this is a two player game, so try to find a friend or coworker to play with.)

Thanks for the info. Lol i never knew you could call this() within a class.

I tried to do something similar to your framework, except with all the Actions and Conditions being defined in different classes. It did seem like I was writing a language inside a language, but there were only four different Parameter classes needed to define all the functionality needed, which were Quantity, PlayerParam, UnitParam, and Area, so it wasn't that big of a deal. The main classes were implemented like so:

Parameter:

1 2 3 4 5 6 7 8 9

packageCremelianWars.Triggers;

/*A parameter is used to test various pieces of data that are sent to Condition objects.*/publicinterfaceParameter{

/*Tests of a given player has accumulated a certain amount of funds: ----------------------------------- Requires PlayerParam, Quantity Tests Player */publicclassAccumulateextendsCondition{PlayerParamactivePlayer;QuantitycompQuantity;

Basically, this implementation just cascades tasks to break them up into smaller and smaller segments, them being trigger -> condition -> Parameter. But because all of the conditions deal with different things, it seemed like a good idea to use an ArrayList of objects. Since that's the case, though, its almost impossible to make these function within some sort of a loop, since they all have variable needs. Typing them out isn't easy either. I tried implementing the system, and it took a good deal of work to make the system perform a simple task, which looked like this:

Which brings me to my next point of how to use them in a map editor. I suppose there could be a toString method associated with each, as well as a buildFromString method, so the user could type them in. XML would probably work better, but the map is already loaded using a similar method dealing with break chars. So, does there need to be some sort of a static factory method to create these, or do you guys see another way?

Oh yeah, and in the above piece of code, below the comment:"//Creates the conditions from the parameters",The compiler displays that its illegal to pass those three Parameters to the Control Condition. It would probably be beneficial if there was someway around this, as to allow for more generic objects to be passed.

/**Tests if a player has a certain amount of units: ----------------------------------- Requires UnitParam, PlayerParam, Quantity Tests GameMap

This method loops through the game map, getting every location, testing if the unit it contains meets the test of the unit parameter, and if it does, adding it to a total, which is then tested against a quantity. */

Right now I'm trying to implement triggers, and would like some input on the following way of doing it. Essentially, the trigger class runs all Action objects stored in it if all Condition objects are met. So it would perform some sort of loop through the set of conditions, and if all were met, then it would loop through all actions, running each one.

So, a Condition could be something like... having the least amount of funds, having the most units in total, bringing exactly 3 units at a certain location, and an Action could be something like give player $50, create a unit for the player, etc.

However, in order to do something like that, you would have to have some sort of Parameter objects for each Condition. For example, in the following condition (Current Player) brings (at least) (5) (Infantry) to Location (Bring units here!), all the things in the parenthesis should be parameters. As they are not numbers, though, I'm not sure how to construct it so it works like that. I suppose there could be a Quantity extends Parameter object, which could have final ints like AT_LEAST, EXACTLY, AT_MOST, and then an actual value. Which means that a condition must be able to call a parameter with some sort of a value, say, an int, which should return true if that value meets the conditions, or false other wise.

And for the (infantry) parameter, there could be a UnitParameter, which returns true if a unit its sent meets the data it was initialized with.

It seems like that would most likely be the exact same thing that should be done with Action objects, so perhaps both of them should extend some super class. Not sure though.

Oh yeah, and for (bring units here!) there could be an Area object, with data types such as a starting point (2,2) and an ending point (5,5), as well as a name. This would work for testing if an object is in those bounds, but I'm not sure how it would work for creating objects in those bounds.

So, what do you guys think? Any suggestions before I try to implement this?

Hmm.. This seems like it could work, or at least something that could be built off of, so thanks for the link. I'll try implementing it some time next week. (Gotta study for the actual computer science AB exam first!)

To pjt33:Yeah, that's exactly how I'm doing my spriting stuff too. At first I used a color image method that would merge two colors together, but this would also effect the color black (which should always stay black to give something its outline), so I decided on grayscale. However, this forces you to do everything pixel by pixel, which does take forever. Now that I think of it, however, it could be possible to convert an image to grayscale using a filter, and then run it through this method. I'll go try it now.

If any of you are curious, here is what the marine idle animation looks like before its colored:And then colored:

EDIT:Grayscale on non-hand drawn images doesn't work that great. They only look decent when the saturated image has the same color as the original image.Original:Randomly colored:

Well, it's been a while, but I think I've accomplished enough work on this to post an update. As I stated in my first post, this is my first game, so I would like to post what I have so far and see if anyone can run it. It's an applet, so even though a program might function inside an IDE, it might crash outside of one, which is why I would like some users to test it. However, I don't have a website, so would like some suggestions about how to put it up for download.

Here's a screen shot:

Regarding the actual game programming, however, I also have a couple of questions that I've had difficulty finding the answers too. As of now, there are no objectives of any sort, because I wanted each map to be dictated by various triggers encoded into the map. For example, there could be triggers not just for Mission Victory/ Mission Defeat, but instead, stuff that would also allow scripted events to happen, like if a marine is brought to location 2,2, a moving tank appears for, say, player 1.

Has anyone ever implemented a system like this, or something similar?

Also, I'm drawing a complete blank with how to code TBS ai. I suppose it only has to be calculated once, but I'm not sure what exactly goes into making a fully functioning ai, that will move units, build structures, and finally end its turn.

I'm really excited about this game, and can't wait to finish up the complete version! By the way, if any of you are curious, this game was completely rewritten from the ground up. The old version was scrapped a few days after demonpant's post, which made me realize just how much my code was repeating itself just to perform a simple task. It's currently 6000 lines of uncommented code, and like 8k commented.

Dude, virus effect is an awesome game, I really enjoyed playing it (#8 on leaderboards lol), but here are some quick things off the top of my head that you might want to consider changing:

You should give the gravity gun some other effect so that users are tempted to use it. Other guns, such as the grenade launcher, are just much more useful. You could add a bunch of secret areas to make it worth while, or upgrade it so that it paralyzes the hit enemy units.

Next is the flamethrower, which also feels a bit watered-down. You should give it a higher base damage if it has one, as catching an enemy on fire is fairly easy, but it takes for them too long to die. Another effect that might be good is that fire will continue travelling after it hits a target, so that you can really create the apperance of a fire storm. This would be great on that intro level with the huge mass of boxes.

You might want to tone down a bit how much an enemy flies back when shot, or make it based on the weapon strength and the enemy weight, since rapid fire weapons seem to send enemies flying (especially the last boss on level 7). You could also add some code to remove some of the stacking that occurs when several enemies are chasing you at once, which is especially noticable with blobs. That's basically it for monsters

Some other things I've seen are that the mouse scroll will move the page, that the background music heavily impacts the game's performance, and that often times those health and armor powerups get stuck under a stack of boxes, which gives it an unrealistic feeling.

This game is already great, but imo with some of those things buffered out, it can really get popular. Your 'X' version is comung along great too, can't wait to see it.

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