Slick Forums

Discuss the Slick 2D Library
It is currently Tue Jun 18, 2013 9:01 pm

All times are UTC




Post new topic Reply to topic  [ 111 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
Author Message
 Post subject:
PostPosted: Tue Jul 22, 2008 5:34 am 
Offline
Game Developer
User avatar

Joined: Sun May 25, 2008 9:45 am
Posts: 578
When can we play!? :D

Scripting maps sounds really cool. It would be neat to make a super clean, well documented, public API for use in map making and enemy AI. Boss encounters could be scripted, like spawning projectiles or enemies around the player in a circle, etc...

Also, I couldn't mention scripting in a post without saying Pnuts would be an awesome choice for a scripting language. 8) To make Kev happy though, I'll also mention Fscript :p, which seems to be a super lightweight, very basic scripting language which is perfect if it does everything your game needs.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 22, 2008 11:04 am 
Offline
Regular

Joined: Sat Jun 07, 2008 6:54 pm
Posts: 119
For someone not that adept at the programming world...
Why do you use a scripting language?

I see php as a sort of scripting language.
Java in itself is a language a bit more powerful than php for example, so why do you need to create a new language to program your application?

I'm not saying you shouldn't, I want to learn why!
And in what cases?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 22, 2008 12:57 pm 
Offline
Oldbie

Joined: Tue Jun 17, 2008 5:11 pm
Posts: 336
The biggest difference between a scripting language and, say, Java is that a scripting language is run w/o compiling it down to machine code. This means that the application can run a new script (say modifying the enemy AI) w/o having to be recompiled.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 22, 2008 7:26 pm 
Offline
Game Developer
User avatar

Joined: Sun May 25, 2008 9:45 am
Posts: 578
PHP is a scripting language, not just sort of. :) PHP is not necessarily less powerful than Java.

The main advantage of Java is it is compiled and strongly typed. That means a few things. It is compiled, so it is fast and you will know about many kinds of problems in your code before you ever run it. Also you are more certain what type of an object you have a reference to. These things increase your confidence in the code you write, making Java nice for enterprise applications where fewer bugs and stability are most important. Also the development tools for Java are very powerful (Eclipse, NetBeans).

The downside to Java is it is not a terribly expressive language. It often requires quite a bit of code to express what you need it to do. Many scripting languages give you syntactic shortcuts to allow you to express things concisely. Eg, there are some Java vs Pnuts comparisons here...
http://pnuts.org/articles/pnutsHighlights.html

Java is neat because it is made up of multiple parts. One part is Java-the-language, this is the Java code you write. Another part is Java-the-virtual-machine (aka JVM). Java-the-language compiles into byte codes, which the JVM executes. Because the language is decoupled from the JVM, you can write Pnuts scripts (for example) and then compile your Pnuts scripts into byte codes and execute them on the JVM. Java-the-language, Pnuts, and others that compile to bytecodes are known as JVM languages.

</thread hijacking> 8)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 22, 2008 8:19 pm 
Offline
Regular

Joined: Sat Jun 07, 2008 6:54 pm
Posts: 119
manunderground wrote:
The biggest difference between a scripting language and, say, Java is that a scripting language is run w/o compiling it down to machine code. This means that the application can run a new script (say modifying the enemy AI) w/o having to be recompiled.


So this would be good for example when you want others to modify your game easily?

Otherwise, isn't it just as easy as to hit compile&run in Eclipse for example?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 23, 2008 12:53 am 
Offline
Regular

Joined: Sat May 31, 2008 12:26 am
Posts: 207
Like I said, the language I'm creating is mind-numbingly simple. It's not much of a language at all, but a set of short-cut commands and arguments that are passed into the code. It doesn't recognize white-space (yet), and every statement and argument must be typed on a different line. Basically all I have running now is the ability to load new entities into the map, but eventually I plan to add AI nodes and parameters (such as convoys and ambush areas, as well as details regarding exactly when enemies will spawn).

After I get the map-loading finalized, I will use the same method for map-saving. At that point, it might allow me to create a graphical map editor for easily creating my maps. Right now its extremely tedious to define entity locations and parameters, and it would be great if I could just plop them down in an editor, translate that into script, and then load the script in-game.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 23, 2008 3:37 am 
Offline
Regular

Joined: Sat May 31, 2008 12:26 am
Posts: 207
* added ability to store map in a cache, and load from a cache, rather than reloading the map from a file each time the game restarts.

*added ability to load docks

*prompt to enter the buy menu or undock now appears relative to the screen, rather than relative to the dock. This was causing issues with multiple docks on-screen at once.

my next tasks:

1. Make more than one type of planet available
2. Find a way to get asteroids to orbit in a perfect circle around the planet without colliding with it, no matter where the asteroid spawns.
3. Make a new class for graphs and nodes that the AI can follow. For instance, I want to be able to place dynamic nodes on the map which give the AI information like "trade route", "ambush area", "do not enter", etc. These nodes will be linked together, and the AI will try to trace a path through meaningful nodes to perform a task. For example, a trading vessel might follow a path of caravan nodes from one area of the map to another, or a pirate might plan a path around the map which avoids friendly ships. I also want to use this node system to be able to define a line around which asteroids are randomly spawned on map startup (currently they spawn in a circle around a pre-defined point).
4. Come up with a way to save maps.
5. Devise a way to move between maps.
6. Make a map for stress-testing to figure out what is the best density for entities in a map.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 24, 2008 4:40 am 
Offline
Regular

Joined: Sat May 31, 2008 12:26 am
Posts: 207
*maps now save and load from saved files perfectly. Will add a hotkey for saving the game soon.

*disabled all particle systems on reload.

*got around to closing those file streams.

*added a new type of planet called "MOON" which is 1/2 the size of the default planet and looks like... well, the moon. Will gradually add more.

!!- New bug: some particle systems have magically disappeared on map loading, will debug to figure out why this is the case. Something tells me I will have to enable those particle systems. For some reason they might not be enabled on their own.

TODO:
1. AI graphnode system.
2. Graphical map editor program. My basic idea on this is to copy all of the code from the game, slap "Development Kit" onto the name, and add the ability to select from a graphical interface to plop down objects onto the screen with the mouse. Then it will be a simple matter of using my new save functions to turn them into working maps.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 25, 2008 3:47 am 
Offline
Regular

Joined: Sat May 31, 2008 12:26 am
Posts: 207
*been working on the map editor. I can now add entities successfully and move the camera around independently of the player.

Screenie:
Image

Now I will add saving and possibly loading to the map editor.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 25, 2008 1:22 pm 
Offline

Joined: Mon Mar 31, 2008 5:31 pm
Posts: 59
Location: Italy
ahah cool

when can we try it? :lol:


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 25, 2008 4:57 pm 
Offline

Joined: Tue Jun 03, 2008 5:13 pm
Posts: 38
what are you using for your GUI interface stuff? thingle/sui/other?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 25, 2008 7:47 pm 
Offline
Regular

Joined: Sat May 31, 2008 12:26 am
Posts: 207
using SUI.

I'll try to make this available soon, but, as I have already tried to get the .jnlp to work, I wouldn't get my hopes up if I were you.


*map saving now works

*Trying to add a TextField to the map editor to define a map name, but "TextField" isn't recognized by SUI for some reason. It recognizes it as a class name, but does not recognize any of its constructers. I Tried redefining the "TextField" as a "TextArea", but upon starting the game, the program hangs and crashes whenever I try to use a TextArea. I really wish SUI were still active so I could get some help in this area.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 25, 2008 10:44 pm 
Offline
Regular

Joined: Sat May 31, 2008 12:26 am
Posts: 207
*maps can now be saved and loaded by the user by typing into a textbox. Controls for the map editor were changed from "M" (open map editor) and WASD (move camera) to TAB and arrowkeys as not to interfere with typing.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 26, 2008 12:31 am 
Offline
Regular

Joined: Sat May 31, 2008 12:26 am
Posts: 207
Sorry for all this posting, but development has been pretty fast these past few weeks. The map editor has given me a lot of opportunity to debug.

*sentry guns now have slightly randomized firing times so that they don't always shoot in the same phase.

*all weapons now have a slight accuracy modifier, which ensures that guns are never 100 percent accurate. Unfortunately this makes pirates even more ineffective, since they can't lead the player, and don't compensate for their own velocities affecting their bullet's velocities.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 27, 2008 6:16 pm 
Offline
Game Developer
User avatar

Joined: Sun May 25, 2008 9:45 am
Posts: 578
You could release it as a zip of JARs. You don't have to use JNLP! Plus if you did that, we could create a JNLP for you.

You might check out Thingle. :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 111 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group