2D game engine with newLisp

Q&A's, tips, howto's
ale870
Posts: 297
Joined: Mon Nov 26, 2007 8:01 pm
Location: Italy

2D game engine with newLisp

Post by ale870 »

Hello,
after several months of absence, I restarted to work with newLisp. In this time I made a lot of experience making 2D and 3D games.
Now I wanted to make "a big step": I'm working to create a program to make GUI and 2D games using newLisp as scripting language.
I'm working also to create an IDE to work with it and, maybe, I will restart to make the fancy editor I started in the past (ZuQu Editor).

I have a couple of questions:

1) Can I sell the environment for a cheap price (e.g.: 5 euro)? There are some problems to sell my complete environment regarding newLisp license? Am I obliged to publish the source code of my game engine if I use newLisp (due to its license)? Can I include newLisp DLL in the distribution or I only need to supply the web address so the people can download newLisp? I wanted to sell the game just to get some funds to maintain the site, the tools I bought, and to get some money (I could even accept some donations or sponsors).

2) Do you think it could be an interesting product?

Consider that I already made several tests, and I already made some optimizations and, it is FAAAAST!
Can you give me some comments, suggestions, etc... about it?

Thank you!
--

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: 2D game engine with newLisp

Post by HPW »

Hello,

Lutz has posted some interesting new infos here:

http://newlispfanclub.alh.net/forum/vie ... f=2&t=3903

So when you deliver a unchanged DLL and provide a link to the newLISP-site you should be fine.

Some questions:

On which OS ?
Do you use other development systems for the GUI or native system calls?
Do you plan to package your lisp-source to hide them from the end-user?

>Do you think it could be an interesting product?

Depends on the game-conzept.
A used tool does not make it interesting alone, gamer does not really care about the used language I think.

Regards

Hans-Peter
Hans-Peter

ale870
Posts: 297
Joined: Mon Nov 26, 2007 8:01 pm
Location: Italy

Re: 2D game engine with newLisp

Post by ale870 »

Thank you for the link, I will read it immediately :-)
Some questions:

On which OS ?
Cross platform: Linux, Mac & Win
Do you use other development systems for the GUI or native system calls?
This new environment will contain functions to build a GUI (so unrelated to 2D game engine self). IN that way you can use this engine to build efficient GUI to make programs with GUI. The system is faaast since I don't use sockets to let newLisp communicate with my engine, instead I map engine functions in newLisp, so newLisp can call engine functions like you can do using a DLL: it means the function call is fast and efficient.

No native system calls for now. This is the concept: if you use a scripting language, it means you need to do something quickly, so you will have some functions that automatically manage the "dirty" job. Obviously, every function will have several options to make it flexible.
Do you plan to package your lisp-source to hide them from the end-user?
No! I think newLisp is a wonderful language (I used it from several years), so newLisp will be the official programming language to use this engine. Furthermore, I'm working hard to try to find a good compromise between efficiency (a.k.a speed!) and newLisp "philosophy" (programming concepts, coherent syntax, etc...).
Even if the engine will not be open source (and will cost a "symbolic" price of about 5 euros), I will leave "open" as much as possible. Furthermore, if I will interrupt the project for some reasons I will release the source code of the project self. About this last point, consider that I'm already commenting the source code in english language (even if I'm italian), and I will apply comments to be clear for everyone (I hope! :-)
A used tool does not make it interesting alone, gamer does not really care about the used language I think.
Yes, of course you are right. But consider that this engine is not for "the final user", but for the programmer. And a programmer is really interested to the programming language, the IDE, etc...

EDIT: Ops, I forgot to talk about 2D engine!
You will be able to make full screen games, windowed games, andyou will be able to use 2D acceleration in a kind of canvas inside the GUI (as part of your program).
--

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: 2D game engine with newLisp

Post by HPW »

Do you use other development systems for the GUI or native system calls?
So where is your engine writtem in?
C or Java or ......?

Of course the project sounds interesting.
Happy coding.

Regards

Hans-Peter
Hans-Peter

ale870
Posts: 297
Joined: Mon Nov 26, 2007 8:01 pm
Location: Italy

Re: 2D game engine with newLisp

Post by ale870 »

I'm using 3 technologies:

1) newLisp for scripting :-)
2) BLitzmax for application engine (manage GUI, 2D and more) http://www.blitzbasic.com
3) LiveCode (ex Runtime Revolution) to create the IDE http://www.runrev.com/
--

ale870
Posts: 297
Joined: Mon Nov 26, 2007 8:01 pm
Location: Italy

Re: 2D game engine with newLisp

Post by ale870 »

Hello,

I made several steps forward in 2D Game engine side.
Now newLisp directly maps engine functions (no ICP communication or socket communication, but direct call, like a DLL).

Now I'm working to fix some issues, and I'm creating some conventions and fix function names structure.

I will open a dedicated web site soon, just to show a works-in-progress of the engine.

NOTE: I can manage, from newLisp, in real time, thousand of rectangles in real-time ;-) (60 FPS)

One thing more: I called this engine (GUI and 2D game engine) "Bite The Byte" :-)

I will supply more info very soon!

Cheers!
--

ale870
Posts: 297
Joined: Mon Nov 26, 2007 8:01 pm
Location: Italy

Re: 2D game engine with newLisp

Post by ale870 »

Hello,

I just opened a new domain for this program: www.bitethebyte.net

It is still empty, but now I will use it to store a draft of the engine.
Basically it is an executable, and will allow you to make some trivial scripts, just to "taste" the engine.

Very few functions are available, but good enough to realize a simple game like "Game of Life".

I will publish the engine (now for WIndows only, sorry) and some basic scripts just to explain some key-concepts (this engine contains some intersting features).

I will publish the files within this week.

Cheers!
--

ale870
Posts: 297
Joined: Mon Nov 26, 2007 8:01 pm
Location: Italy

Re: 2D game engine with newLisp

Post by ale870 »

Some days ago, some friends of mine made me an interesting question: (they said): "do you think it is useful to make another 2d engine? no body wants any more 2d engines, and in the market there are good engines".

So my mind "crashed": do you think it could be nice making a 2d engine (with an IDE) using newLisp?

Please "unlock" my mind!

Thank you :-)
--

TedWalther
Posts: 608
Joined: Mon Feb 05, 2007 1:04 am
Location: Abbotsford, BC
Contact:

Re: 2D game engine with newLisp

Post by TedWalther »

If you want to make money, well, who knows.

But, I think it is beautiful. My favorite games are 2D. I play flash games in my browser, mainly "Tower Defense" games. There are a lot of "little old ladies" around who are addicted to "Bejewelled", "Majhong", and "Solitaire". I miss the old platform run and jump games. With the right 2D engine, maybe I'd try an update of Duke Nukem 2, Sonic, or Mario. Who knows...

Dino Run is fun, but imagine how much nicer it would be with better graphics, and smoother gameplay. The GC in Flash gives these games unacceptable limits and slowdowns that kill the gameplay. Having rock-solid physics would be the best.

Puzzle games aren't going out of style. The 'Zuma" family of "shoot colored marbles" games is a lot of fun too.

So... please do finish your 2D engine! Can you do a sprite based compositor?

SDL is crossplatform; perhaps make your 2D engine be a wrapper on top of that? That way a person could bundle a game for Windows, Linux, and Mac.

Another another game related topic; what is the "secret" for transitioning music in games? I've noticed that music "transitions" depending on game state, from different themes, to just different tempo and mood. How do they do it so it doesn't miss a beat or sound glitchy? It is always a smooth transition. It is as if there are breakpoints set inside each tune for potential transitions.
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence. Nine months later, they left with a baby named newLISP. The women of the ivory towers wept and wailed. "Abomination!" they cried.

ale870
Posts: 297
Joined: Mon Nov 26, 2007 8:01 pm
Location: Italy

Re: 2D game engine with newLisp

Post by ale870 »

Thank you, your words are like "honey" for my brain.
My friends said that there are a pletora of 2D engines already in the market (Yoyo Game Maker, Multimedia Fusion, Blitzmax, DarkBasic, Torque 2d, Love 2d, etc...).

http://en.wikipedia.org/wiki/List_of_game_engines

http://rampantgames.com/community/viewtopic.php?t=697

So I like your happiness about newLisp in 2D, but... don't you think that there are already enough engines available?
In my mind I think all those engines have similar languages for programming, and use similar tools.

I think newLisp, a functional language, could be REALLY different. Furthermore, I'm working to make an engine based on templates and detachable properties.

Ok, I will publish a version 0.00000000001 of BiteTheByte very soon.
--

ale870
Posts: 297
Joined: Mon Nov 26, 2007 8:01 pm
Location: Italy

Re: 2D game engine with newLisp

Post by ale870 »

Thank you, your words are like "honey" for my brain.
My friends said that there are a pletora of 2D engines already in the market (Yoyo Game Maker, Multimedia Fusion, Blitzmax, DarkBasic, Torque 2d, Love 2d, etc...).

http://en.wikipedia.org/wiki/List_of_game_engines

http://rampantgames.com/community/viewtopic.php?t=697

So I like your happiness about newLisp in 2D, but... don't you think that there are already enough engines available?
In my mind I think all those engines have similar languages for programming, and use similar tools.

I think newLisp, a functional language, could be REALLY different. Furthermore, I'm working to make an engine based on templates and detachable properties.

Ok, I will publish a version 0.00000000001 of BiteTheByte very soon.
--

TedWalther
Posts: 608
Joined: Mon Feb 05, 2007 1:04 am
Location: Abbotsford, BC
Contact:

Re: 2D game engine with newLisp

Post by TedWalther »

Sure there are lots of engines available. But I don't have time to write the newLISP interface for it. So if you are writing one, great! I suggest you take libsdl, import the necessary functions, and then write your own interface on top of that. But the ByteMax 2D engine you link to, does look very nice. I only base that on the screenshots; I didn't see any sample code of how it is conceptually organized and designed. Maybe it is a mess. I don't know.

Personally, I would like to be able to draw sprites, plunk arbitrary graphics on the canvas, detect collisions, etc.

Here is a use for the alpha channel; it could be totally transparent, and totally opaque. This would make compositing AND COLLISION DETECTION trivial. libsdl already supports alpha channel I believe. Then I could just use PNG files for graphics.

What do you think?

Remember, don't redo anything you don't have to.
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence. Nine months later, they left with a baby named newLISP. The women of the ivory towers wept and wailed. "Abomination!" they cried.

ale870
Posts: 297
Joined: Mon Nov 26, 2007 8:01 pm
Location: Italy

Re: 2D game engine with newLisp

Post by ale870 »

Hello,
thank you for your suggestions.

My tools are the following (see some posts before ;-) :

1) Blitzmax 2D (http://www.blitzbasic.com)
2) LiveCode for IDE (http://www.runrev.com)

My engine is called BiteTheByte and will be cross platform (this is the reason I selected those tools: Linux Mac PC).

There are:

1) PRimitives (rectangles, oval, lines)
2) Color channel (change color of an image or primitive)
3) Alpha channel
4) Object rotation in real time (no need to create a lot of sprites for rotation!)
5) Collision detection (I'm writing it in these days) it will not be based on pixel perfect, since that method is really Slow. But since I know that a rectangle/oval collision is fast but, sometimes, not so precise, you will be able to create multiple primitives to better fit your sprite.
6) This is a small example of code (working example):

Code: Select all

(btb2d:engine-start 800 600)

(context 'Example1)
	(setq objRect (btb2d:model-create btb2d:MODEL-RECTANGLE))
	(btb2d:size objRect 50 50)
	(btb2d:pos objRect 30 30)
	(btb2d:visible objRect btb2d:TRUE)
	(btb2d:color objRect 255 0 0)
(context MAIN)
As you can see, I created a Rectangle, then I setup position, size, visibility (true), and it's color (RRGGBB).
No need to create forever loop (as many 2D engines do), no need to create an update procedure, etc...

How templates work? Well, imagine a game like Space Invaders. You have a ton of aliens really replicated on the screen, and they change only for position, and maybe, for its color.
Well, in BiteTheByte you will simply load an alien image (in white color, so you can "repaint" it at runtime). Then create a ton of aliens (instances) using that template. When you create an object-instance, the instance is not an independent object (as in many engines happen), but they are tightly linked: if you change something in the template, also all the instances are affected.

Well, since when you create some instances you need to change the position, then you will DETACH THE POSITION property.
Look at this example:

Code: Select all

(btb2d:engine-start 800 600)

(context 'Example1)
	
	; OBJECT TEMPLATE (this is your Alien template)

	(setq objRect (btb2d:model-create btb2d:MODEL-RECTANGLE))
	(btb2d:size objRect 50 50)
	(btb2d:pos objRect 50 50)
	(btb2d:visible objRect btb2d:TRUE)
	(btb2d:color objRect 255 0 0)

	; I will create an object instance (clone).
	(setq objAlien (btb2d:model-instantiate objRect))

	; Detach the properties that will not be "linked together (MODEL<->INSTANCE)"
	(btb2d:prop-detach objAlien btb2d:PROP-POS)

	; Now I can set a new position for this alien.
	(btb2d:pos objAlien 200 200)

(context MAIN)
As you can see, "objAlien" is attached to its template "templateAlien". Then I "detached" the property "position" so the instance is not attached any more to its template.
Finally I set a new position for the instance.
The other properties are still attached together, so if I change the color of the template, then the color of all attached instances is changed also.

Ok, I hope you like this concept. I'm creating a site for this engine, so I will be able to publish something very soon.

Cheers!
--

ale870
Posts: 297
Joined: Mon Nov 26, 2007 8:01 pm
Location: Italy

Re: 2D game engine with newLisp

Post by ale870 »

Hi!!!!

During these holidays I spent some time to improve some functions, to fix the syntax, to make the engine more and more "aligned" to the "philosophy" of a functional language.

Even if a ton of things are still missing, I opened the site, and I published (inside "ABOUT" page) some more information about this engine.
I even published some working examples. Check that page to "taste" this engine, to understand some key-concepts and to discover some interesting features (I worked so much to implement them, so I hope you will appreciate them :-) ).

This is the homepage: http://www.bitethebyte.net/blog/?page_id=2

I created a wiki page also, but I'm working to fill-in documentation.
In fact now I'm working to create documentation for API, for Tutorials, etc...

Today or tomorrow i will publish, in that site, the EXECUTABLE FOR Ms Windows (Linux will arrive soon, and for Mac... I have a problem: I haven't a Mac so I cannot compile and test for it :-( ). I'm looking for a solution (sorry but I haven't money to buy a new Mac now!).

Since the engine version is 0.0000000001 :-) I will distribute it for free now. Later, when it will be to an advanced development stage, I will apply a "symbolic" fee (I think about 5 euro). So donations are really appreciated :-) (thank you in advance!).

Any opinion or comments are really appreciated also, so please write write and write! Send me your comments and suggestions!

I will keep you informed for development status.

Cheers!
--

ale870
Posts: 297
Joined: Mon Nov 26, 2007 8:01 pm
Location: Italy

Re: 2D game engine with newLisp

Post by ale870 »

The download version is ready!
As I said, this is a draft version, but can be used to make easy games like "The game of life" (someone wants to try to make it?).
In these days I'm writing the documentation API and some tutorials.
Check also the page "About" in the blog!

Download Windows version: http://www.bitethebyte.net/wiki/doku.php?id=start

Blog: http://www.bitethebyte.net/blog

Cheers!
--

ale870
Posts: 297
Joined: Mon Nov 26, 2007 8:01 pm
Location: Italy

Re: 2D game engine with newLisp

Post by ale870 »

In the next days I will write-down the remaining parts of the documentation (API), then I will write some tutorials.

ROADMAP FOR THE NEXT WEEKS:
1) Load images to be used as sprites.
2) Collision detection.
3) Sound engine.

Anyone tried the current version? Did you like the concept of <<templates>>? And what do you think about the method to attach/detach properties?
I need your feedback in order to know your opinion, since this 2D engine uses some original concepts, but even if they work well by my point-of-view, I don-t know if other people like them.

Thank you.
--

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Re: 2D game engine with newLisp

Post by cormullion »

Keep up the good work! I can't join in but it looks interesting.

ale870
Posts: 297
Joined: Mon Nov 26, 2007 8:01 pm
Location: Italy

Re: 2D game engine with newLisp

Post by ale870 »

Updated the documentation about the context btbin - Context used for user-input (mouse and keyboard).

Cheers!
--

ale870
Posts: 297
Joined: Mon Nov 26, 2007 8:01 pm
Location: Italy

Re: 2D game engine with newLisp

Post by ale870 »

Hello,

it seems I cannot continue this job, since I was using blitzmax but, in blitzmax I cannot create another "language wrapper" (even if my engine was really different).
The problem is I was using some native blitzmax 2d code, and I cannot do it.
So this project is suspened. Sorry.
--

DavMin
Posts: 16
Joined: Fri Dec 09, 2011 8:07 pm

Re: 2D game engine with newLisp

Post by DavMin »

Maybe you can recreate for HTML5 Canvas?

http://www.newlisp.org/code/modules/canvas.lsp.html

http://easeljs.com/

http://paperjs.org/

http://box2d-js.sourceforge.net/

Though it's 3d, this might inspire:
http://mrdoob.com/129/Voxels
(click the top left frame that says Voxels)

ale870
Posts: 297
Joined: Mon Nov 26, 2007 8:01 pm
Location: Italy

Re: 2D game engine with newLisp

Post by ale870 »

No, my final scope was implementing real 2d/3d engine, not using html like or similar (aka flash).
Sorry.
--

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: 2D game engine with newLisp

Post by Lutz »

How about doing game development in OpenGL (3D capable) and SDL (joystick support) and perhaps FreeGLUT? Popular with game developers and very portable. It's also used on mobile platforms with touch extensions. But you would need to write import modules. For 32-bit this could be done using the old simple import/callback API. Full screen modes are also supported with these libraries. Or use the latest development release with the news extended API. This will also be in a stable release beginning of 2012.

ale870
Posts: 297
Joined: Mon Nov 26, 2007 8:01 pm
Location: Italy

Re: 2D game engine with newLisp

Post by ale870 »

Hello,

maybe this project can be revamped, since Blitzmax changed some licensing options!

http://www.blitzbasic.com/Community/pos ... opic=97652

I contacted the company in order to get highlights about it.
I will keep you informed!
--

ale870
Posts: 297
Joined: Mon Nov 26, 2007 8:01 pm
Location: Italy

Re: 2D game engine with newLisp

Post by ale870 »

Hello,

I talked with Blitzmax responsibles, and they confirmed me I can continue with my project!

So now I revamped my site, and added a Forum area (please let me know if it does not work! :-) )

In this time, I acquired even more info about 2d and 3d engines, so I made some project modifications, and I'm applying them now. I hope I will be able to post an update version of the engine in one week or two.

Modifications made:

1) Full scene-graph support. You will be able to create a scene-graph tree, which will be used from the engine to automatically optimize rendering process (e.g.: not rendering is performed only on visible object, inside the screen; now using the scene-graph the engine will check the "volume" of the objects inside a scene/graph tree. If the volume will be out of the screen, the engine will not check all objects inside the node self.).

2) Nodes management.

3) Object groups management: group some objects together and apply modifications to the objects inside such group using a single command!

4) New automation system: you can "teach" to the engine to apply some algorithms in the time only once (teach and forget!). Then the engine will apply that update. For example:

Move model "M" as position.x=position.x+1 for 60 frames.

(this is a meta-language not the real code!).

Cheers!
--

ale870
Posts: 297
Joined: Mon Nov 26, 2007 8:01 pm
Location: Italy

Re: 2D game engine with newLisp

Post by ale870 »

Hello,

I need some help by you side.
But this time I don't need any info, instead I need your opinion.
While I'm developing this 2d game engine a couple of my friend told me somethings that "frozen" me. They said:
"why do you make another 2d engine? There are many engines that already make a good job, and some of them even allow html5 publishing. Some of them allow to publish for iphone, for android, etc...".

So I said they use the same languages: actionscript, c#, java, lua, etc... and they do not take anything really new. Furthermore, a lot of these engines implement techniques in the same way. Nothing really innovative.
But they are not so convinced. Maybe they are more "traditional".

So my problem is this one: do we (we as programmers, as game makers, etc...) really need another 2D engine?
Can I know your opinion about this? Do we really need of this 2d engine? Or I'm spending time to make nothing useful?

Thank you.
--

Locked