Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / 2DPlugKIT WIP

Author
Message
Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 13th Apr 2007 22:46 Edited at: 25th May 2007 14:52
Hi all,
I develop a new product for Odyssey-Creators (and then, for the DarkBASIC Professional developers community )

This product is designed to help in 2D game creation with DarkBASIC Professional.
Here is a brief overview of features that are planed for this product :

A. 2D Tiles system :
--------------------
- Multi size tiles.
- Animated tiles.
- Handle transparency.
- Tile mask for sprite collision with tile environment.

B. Layers system :
------------------
- Up to 16 layers.
- Multi size layers (each layer can have its own size).
- Display tiles in layers using tiles properties.
- Change layers display priorities.
- Display each layer separately.
- Load/Save layers to disk.

C. Map System :
---------------
- Handle multi-layers maps.
- Load/Save multi-layers maps.

D. Sprites/Entities :
---------------------
- Specific entities system.
- Animated entities.

E. Special Effects :
--------------------
- Pseudo-Lighting system.
- Pre-calculate pseudo-light-mapping using tiles masks.
- simple 2D particles system with presets (like eXtends P3D sets)

Here is the list of all actually available commands in the development version:

Voici un petit up du sujet pour donner la liste des commandes actuellement supportées par l'alpha du plugin:

System commands:
=Start 2DPlugKIT()
SyncFPS FrameRate
=ARgb( Alpha, Red, Green, Blue )
=RgbA( RGBAColor )
=Get Default Tile Width()
=Get Default Tile Height()
=Get Default Tile Transparency()
Set Default Tile Width Width
Set Default Tile Height Height
Set Default Tile Transparency TransparencyFLAG

Tiles commands:
Set Tiles Directory DrawerPath$
Create Tile TileID, ImageID
Create Tile TileID, ImageID, TransparencyFLAG
Load Tile FileName$, TileID
Load Tile FileName$, TileID, ImageID, TransparencyFLAG
Set Tile Image TileID, ImageID, TransparencyFLAG
Set Tile Image TileID, ImageID
Set Tile Mask TileID, MaskIMAGEID
Load Tile Mask FileName$, TileID
Set Tile NMap TileID, NormalMAPImageID
Load Tile NMap FileName$, TileID
Set Tile Transparency TileID, Transparency
Disable Tile NMap TileID
Disable Tile Mask TileID
Delete Tile TileID
Paste Tile TileID, X, Y
=Get Tile Exist( TileID )
=Get Tile Width( TileID )
=Get Tile Height( TileID )
=Get Tile Transparency( TileID )
=Get Tile Image( TileID )
=Get Tile Memblock Image( TileID )
=Get Tile Mask Exist( TileID )
=Get Tile Mask Memblock Image( TileID )
=Get Tile NMap Exist( TileID )
=Get Tile NMap Memblock Image( TileID )
Save Tile To File FileChannel, TileID
Create Tile From File( FileChannel )
Save Tiles To File FileChannel
Create Tiles From File( FileChannel )

Layers commands:
Create Layer LayerID, Width, Height
Set Layer Tile LayerID, XPosition, YPosition, TileID
Set Layer Area LayerID, Left, Top, Right, Bottom
Set Layer Position LayerID, XShift, YShift
Set Layer Position X LayerID, XShift
Set Layer Position Y LayerID, YShift
Scroll Layer LayerID, XScroll, YScroll
Scroll Layer X LayerID, XScroll
Scroll Layer Y LayerID, YScroll
Paste Layer LayerID, Left, Top, Right, Bottom
Paste Layer LayerID
Delete Layer LayerID
Set Layer UV Mode LayerID, U, V
Set Layer Tiles Sizes LayerID, TilesWIDTH, TilesHEIGHT
Copy Layer Destination, Source
Set Layer Visible LayerID, VisibilityFLAG
Set Layer Scroll Mode LayerID, ScrollMODE
Set Layer Scroll Speed XY LayerID, XSpeed#, YSpeed#
Set Layer Scroll Speed X LayerID, XSpeed#
Set Layer Scroll Speed Y LayerID, YSpeed#
Set Layer Camera Mode LayerID, CameraMODE
Set Game Layer LayerID
=Get Layer Exist( LayerID )
=Get Layer Width( LayerID )
=Get Layer Height( LayerID )
=Get Layer Tile Width( LayerID )
=Get Layer Tile Height( LayerID )
=Get Layer UVU Mode( LayerID )
=Get Layer UVV Mode( LayerID )
=Get Layer XScroll( LayerID )
=Get Layer YScroll( LayerID )
=Get Layer Tile( LayerID, XPosition, YPosition )
=Get Layer Visible( LayerID )
=Get Layer Scroll Mode( LayerID )
=Get Layer Scroll Speed X( LayerID )
=Get Layer Scroll Speed Y( LayerID )
=Get Layer Camera Mode( LayerID )
=Get Game Layer()
=Get Layer Area Left( LayerID )
=Get Layer Area Top( LayerID )
=Get Layer Area Right( LayerID )
=Get Layer Area Bottom( LayerID )
Save Layer To File FileNUMBER, LayerID
=Create Layer From File( FileNUMBER, LayerID )
=Create Layer From File( FileNumber )
Save Layers To File FileNUMBER
=Create Layers From File( FileNUMBER )
Paste All Layers
Set Game Layer Position XPos, YPos

Virtual lights commands :
=Add V2DLight( X, Y, RGBColor, Range#, Intensite(%), LightMode, LayerID )
Attach V2DLight To Layer LightID, LayerID
Detach V2DLight From Layer LightID
Show V2DLight LightID
Hide V2DLight LightID
Position V2DLight LightID, XPos, YPos
Set V2DLight Color LightID, Red, Green, Blue
Set V2DLight Range LightID, Range
Set V2DLight Intensity LightID, Intensity
=Get V2DLight Exist( LightID )
=Get V2DLight Layer( LightID )
=Is V2DLightHidden( LightID )
=Delete V2DLight( LightID )

Tiles/Sprites Animations commands:
Create DBal AnimationID, FramesLIST$
Set DBal To Sprite AnimationID, SpriteID
Set DBal To Tile AnimationID, TileID
Set DBal Speed AnimationID, Speed
Play DBal AnimationID
Stop DBal AnimationID
Update DBal

Miscellaneous commands:
=Make 8Bit Memblock Image( MemblockNumber, Width, Height )
=Read 8Bit Pixel( MemblockID, X, Y )
Write 8Bit Pixel MemblockID, X, Y, Color
=Get Layer Pixel( LayerID, XPos, YPos )
=Get Layer MASKPixel( LayerID, XPos, YPos )
=Get Layer NMAPPixel( LayerID, XPos, YPos )



If you have any ideas of features to add in 2DPlugKIT, feel free to add them here and I'll check if they fit to the Kit specifications to maybe add some of them in.

I'll add news to this post sooner.

EDIT: I did forgot to add the functions/commands that are actually done and running. now, it's done.
EDIT: 2007.04.14 - Added 5 Layers commands running perfectly. Also added 7 animations commands.

Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
Alquerian
18
Years of Service
User Offline
Joined: 29th Mar 2006
Location: Reno Nevada
Posted: 14th Apr 2007 00:19
This sounds awesome, can the different layers have different opacities?

Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 14th Apr 2007 00:21
All will depend on the tiles they use. Each tile has its own options and parameters. But I can maybe add an option to force a specific value for the entire layer ... why not ?

Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
wildbill
18
Years of Service
User Offline
Joined: 14th Apr 2006
Location:
Posted: 14th Apr 2007 17:08
Just to let you know I use your extends product. The MBC MAKE MEMBLOCK FROM IMAGE combined with the MBC Get Pixel command works perfectly for mouse mapping.

So I think you definetly need a mouse mapping routine in any 2d program for isometric work.

Also a mini-map function would be nice.
Roxas
18
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 14th Apr 2007 17:15
How 'bout collision?



Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 14th Apr 2007 17:38
@WildBill: What do you mean by "Mouse Mapping" and "Mini-map function" ?

@The Full Metal Coder Roxas: Do you talk about 2DPlugKIT ? or eXtends ? Because eXtends already have a Perfect Sprite Collision System working.

Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
wildbill
18
Years of Service
User Offline
Joined: 14th Apr 2006
Location:
Posted: 14th Apr 2007 19:10
The mouse map is used to convert mouse coordinates into Map coordinates, for isometric games like civilization.

Instead of mousex = 90 and mousey = 40. You would get a tile coordinate like 2,1.

The minimap is a sort of reduced scale image of the main map (radar).
Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 14th Apr 2007 20:25
Ok but these commands are too specific ... They're related only to 3D Isometric games ...
The 2DPlugKIT I try to develop is based on generic 2D games ...
Minimap too is really game specific... it can be handled in some way with my layer system... but not directly.

Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 15th Apr 2007 02:53
I dont see what's wrong with the mouse map thing. It can be used for generic 2d. I use it all the time (I hate Isometric games, if you wanna play 2d then play 2d, if you wanna play 3d, then play 3d. :/ ).

Cheers,

-db


Albert Einstein believed that imagination is more important than knowledge.
Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 15th Apr 2007 10:52 Edited at: 15th Apr 2007 10:53
so, if it's only to know in which tile the mouse is, there is no problem.I'll add directly a dot map so entering a pixel coordinate in screen will reveal the ID of the tile and 2 other commands to get the XTile/Ytile on the map where it is...
Is it what you wanted ?

I have a small multi-layers scrolling demonstration nearly ready. I'll post it soonly to get benchmarks from those that will accept to try it.

Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 15th Apr 2007 11:26
Ok then. Well, keep up the good work.
btw, Are you using your purebasic dbp dll thing on this?

Cheers,

-db


Albert Einstein believed that imagination is more important than knowledge.
Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 15th Apr 2007 11:50 Edited at: 15th Apr 2007 11:53
@DB User 2006+ :
Yes, I use my PurePLUGIN system because it initialize all thing for my new plugin

Here is a small demo attached to this post for thoses that wanna try it and give me the frame rate (perfs) depending on their specs...

Here is the demo source commented:


A small shot of the scroll demo:


Of course, layers can be saved/loaded to/from disk

Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor

Attachments

Login to view attachments
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 15th Apr 2007 11:55
Good work freddix!

I get around 280 fps... I have an ATI Radeon graphics card.
2.4GHz AMD Athlon 64 Processor
940~ MB RAM
Windows XP Media Center Edition

Cheers,

-db


Albert Einstein believed that imagination is more important than knowledge.
wildbill
18
Years of Service
User Offline
Joined: 14th Apr 2006
Location:
Posted: 15th Apr 2007 16:56
Quote: "so, if it's only to know in which tile the mouse is, there is no problem.I'll add directly a dot map so entering a pixel coordinate in screen will reveal the ID of the tile and 2 other commands to get the XTile/Ytile on the map where it is...
Is it what you wanted ?

"


Sounds good.

I get about 290 fps on a Dell M70 laptop.
Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 15th Apr 2007 18:27
Cool

I've added the "Static Light-Mapping" calculation system. When you create a light, it precalculate it and you can attach it to a choosen layer. It will then be displayed with the layer.
I'll add later shadow casting using Tiles MASK and Pseudo-Normal mapping using Tiles NORMAL MAP. (these are ideas I have and I know how to include them :p)
These features may give nice graphical effects :p to static lights.

Attached to that post a snapshot of the demo with 4 static lights with various intensity.

Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor

Attachments

Login to view attachments
Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 17th Apr 2007 01:16
Now that the default "Static light mapping" is done, I'm working on some sort of Fake "Light Mapping" with "Normal Mapping".
It uses a normal mapping texture you can attach to your tile to calculate a lighting effect.

Here is an alpha shot of the effect that need more tweaking and improvement but that is promising I think :p


Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
zzz
18
Years of Service
User Offline
Joined: 13th Nov 2005
Location: Sweden
Posted: 17th Apr 2007 18:14
Really nice!
How much will this kit cost?

WII number: 8220 5043 6939 7393
Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 17th Apr 2007 18:55
it may be in the same price range than eXtends. No more

Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 18th Apr 2007 00:49
I can no say that the "Normal-Light mapping" is now in BETA state (no more in alpha :p)
I managed to make it work like I wanted
I have to tune it up a bit to have a smoother rendering ...

It gives this kind of results :

This effect does not affect frame rate because it is pre-calculated but the pre-calculation time can be long if many lights are available in the full map...

Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 18th Apr 2007 03:28
Freddix, did you use the globstruct to retrieve the core handle to the current bitmaps surface in order to draw those images? If you do, it may save you even more FPS. Unless, however, you rely on some sort of a differant system. Well, either way, it seems to have a good frame rate.

Cheers,

-db


Albert Einstein believed that imagination is more important than knowledge.
Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 18th Apr 2007 15:17 Edited at: 18th Apr 2007 17:14
DB User 2006+:
No, I didn't do that but, it's an idea to "explore"
If you have any clues about this, feel free to give them :p

Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 18th Apr 2007 23:16
The Pseudo Light Mapping is now done. I will add shadow casting support using collision mask image.

Here is a snapshot of the final Pseudo Light Mapping running with a comparizon with/without the PLM and, on the right, the tile map showing all tiles and the Normal mapping textures:



Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 19th Apr 2007 04:03
Well, you obviously did a good job. I will elaborate more on what im talking about on MSN.

Cheers,

-db


Albert Einstein believed that imagination is more important than knowledge.
Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 19th Apr 2007 20:01
I've added the shadow casting option.
It work using a shape mask (it's a tile with at RGB(255,255,255), the shape of the object it represent.
Here is a sample with both LightMAPPING and ShadowCASTING running :



Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 2nd May 2007 13:12
Hi,
Now that my Wedding is past :p I can continue to work on Odyssey-Creators projects :p

I've made another small demo that wil be released in the final package showing simple lighting on objects that has normal map texture.
It gives that kind of results:



I will now start to work on collisions system.

Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 5th May 2007 00:28 Edited at: 5th May 2007 00:30
Are those flames animated? If so, how do animated tiles work?

edit:
Also, what about lights with a radius, so its not just a point of light?

Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 5th May 2007 01:47
Animated tiles work (flames are animated)
To create an animated tile, you create a sequence using a string. This way :


Here are the commands explanation:

CREATE DBAL Channel, Sequency$
Create a new animation sequency
Channel = The ID of the animation sequency
Sequency$ = The sequency itselft. It's composed by:
ANIM: and a list of image number separated by a ";". The sequency must finish with a ";" too.

SET DBAL TO TILE Channel, TileID
Assign a DarkBASIC Animaiton Language sequency to a specified tile.
Channel = The ID of the animation sequency.
TIleID = The ID of the tile.

SET DBAL SPEED Channel, Speed
Specify the speed used to play the animation.
Channel = The ID of the animation sequency.
Speed = the speed in frames/second.

PLAY DBAL Channel
Start to play the animation sequency on the assigned object (tile or sprite)
Channel = The ID of the animation sequency.

Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 18th May 2007 21:16 Edited at: 18th May 2007 21:16
I've improved the Normal Mapping demo to show more the light effect.



Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor

Attachments

Login to view attachments
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 19th May 2007 10:16
I'm enjoying the looks of this. Keep it up, you already have one ready customer.

Cheers,

-db

Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 25th May 2007 14:53
Small up with the list of all actually availables commands in the plugin wip
(list is updated in the first post of this thread)

Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 8th Jun 2007 21:01
Some news from 2DPlugKIT.

I've now added the Sprites for Layers. It's a command set to use sprite attached to layers.

I've also added the 2D Particles command set.
This set is similar to eXtends Particles but for 2D. And of course, these particles can be linked/attached to layers too

Here is a small snap :


Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 14th Jun 2007 00:35
I really like the 2D lighting

Mr Kohlenstoff
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Germany
Posted: 14th Jun 2007 15:22
Woah, great work.. fantastic lightning-effects!

Visit the DBPro - Speed up your game-Thread. http://forum.thegamecreators.com/?m=forum_view&t=88661&b=1

Login to post a reply

Server time is: 2024-09-29 20:22:55
Your offset time is: 2024-09-29 20:22:55