It is currently Tue Dec 12, 2017 6:05 pm

All times are UTC + 9:30 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: CWT Devel Diary #1 -> 04.04.2010
PostPosted: Sun Apr 04, 2010 7:14 pm 
Offline
User avatar

Joined: Fri Apr 10, 2009 12:13 am
Posts: 55
So I will start the development diary of Custom Wars Tactics :)

At the moment we're working on the two main parts, the graphic engine and the
script engine. Js works on JSlix , it's a tile based graphic engine on Slick atm , maybe it will be pure Java2D because on Slick we have reached a speed of 1500-2000 fps on a macbook against our old speed 500 fps.
These results we've got due an intelligent way of rendering screen and this gives us the ability to develop also a pure Java2D version of it.

I'm working on MeoW Script v0.4 atm, it's a byte code scripting engine. This engine will give us the ability to compile byte code at runtime without a JDK.
It is almost 100 times slower than native java code but 60 times faster than LUA! That makes possible to outsource the model and logic from the program to outside script files.
This enhance our development speed and gives allot of customize ability.

What my status ?
- MeoW Parser 50%
- Shape done

If all going fine, MeoW will done next week, so we can build CWT model soon. No building is wrong , we moving it from program core to the scripts ;)

A script will look like a normal java source file with some specials.
The biggest change is, that we have no { }, we use the same system as python to declare blocks, that means it is important how far is the distance from the left side of the file to the first char.
Furthermore we have dynamic typing, you can define names as types, so you don't need to type it in you file. E.g. in this file we say all variable names with i at starts are int, so iX , iY will be automatically interpreted as int's by MeoW compiler.
All variables in MeoW are private , so the word private means not private as in java. It means internal, if a meow variable is private, then the compiler generate private getter and setter for that variable. All variables will get automatically getter and setter methods. If you declare a statement in the variable block after the variable, then it means you add a condition to the setter method. E.g iZ { iZ >= 0 } , that means if you make set_iZ( -1 ) , then the program will throw a RuntimeException at runtime that says that you violated that condition.
Furthermore , if you have only one expression in a line , then you don't need to type a ; at the end of it.

Code:
// test script class
class Unit :
   
   // declaring block for instance variables
   variables :
      iX        { iX >= 0 && iX < 10 }
      iY        { iY >= 0 && iY < 10 }
      private iZ    { iZ >= 0 }
      
   // constructor
   constructor( iX , iY ) :
      this.iX = iX
      this.iY = iY
      
   private test( iNumber ) :
      iZ = iNumber
      
   testWhile( iterations ) :
      testWhileMul( iterations, false )
         
   testWhileMul( iterations , boolean doMul ) :
      while iterations > 0 :
         if doMul : mul(8,8)
         iterations--
         
   int mul( i1 , i2 ) :
      i3 = 0
      while i2 > 0 :
         i3 += i1
         i2--
      return i3
      
   private static statTest() :
      // nothing
   
   test2( iNumber ) :
      iN = iNumber
      test( iN )

_________________
my name is BlackCat


Top
 Profile  
 
 Post subject: Re: CWT Devel Diary #1 -> 04.04.2010
PostPosted: Wed Mar 20, 2013 9:04 pm 
Offline
User avatar

Joined: Fri Apr 10, 2009 12:13 am
Posts: 55
Ah this brings memories back when I see that post. :mrgreen:

_________________
my name is BlackCat


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 9:30 hours


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:  
cron
Blue Moon by Trent © 2007
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group