Irrlicht 1.8.3 Wrapper and Source for Blitz!

Blitz3D Forums/Blitz3D Userlibs/Irrlicht 1.8.3 Wrapper and Source for Blitz!

AquaLung(Posted 2016) [#1]




07/05/2016
Have not been doing any work on this so I might as well share, maybe someone else can improve it. Now compiled against Irrlicht 1.8.3 and source code included.

Enjoy!
Ed Musolino (AquaLung)


=======================================================================
Irrlicht 1.8.3 Interface for Blitz (source included) based on Frank Dodd's Freebasic Wrapper for Irrlicht 1.7. Supports OPENGL and DIRECTX9.

- NOTE:
* See the _READ_ME.txt file!

* The XEffects examples will only work if your video card supports it!

(RELEASE 07/05/2016)

bIrrlicht 2.0 for BLITZ (Irrlicht 1.8.3)


=======================================================================


Guy Fawkes(Posted 2016) [#2]
I just tried to compile the Video Example for B3D & it said user lib not found even though I put the DECLs in the userlibs folder & the DLL in the same folder as the example...

~GF


Yue(Posted 2016) [#3]
Thank you very much , I thought you were dead too .

It is a good opportunity to try to learn something about looking at the project. :)






AquaLung(Posted 2016) [#4]
@GF

If you don't have MSVS2015 installed, you probably need to install the Redistributable for C++ VS2015, It can be located on Micr0s0fts Site. It is required since bIrrlicht.dll is compiled with VS2015.


AquaLung(Posted 2016) [#5]
Oh, and I'm still alive, just been away for a while....


Yue(Posted 2016) [#6]
@AquaLung ;)

I'm not a programmer , I have always curious, but that facility has power increase in the project , physics, shaders and things like that ?

I would like to continue you with the project, from my point of view I think it is a good tool for users Blitz3D .

A greeting.


RustyKristi(Posted 2016) [#7]
This is awesome Aqualung, thanks for the update! :D

Is there any way you can release the wrapper source? maybe github?


Guy Fawkes(Posted 2016) [#8]
I already have it :(


AquaLung(Posted 2016) [#9]
I did include the wrapper source in the download. You just need to DL irrlicht 1.8.3 source and irrklang 1.4.0 and compile.

I can take a look at placing on Github.


RustyKristi(Posted 2016) [#10]
Thanks AquaLung! :D


Rick Nasher(Posted 2016) [#11]
Great stuff (as always)


AquaLung(Posted 2016) [#12]
You guys are welcome.


outsider(Posted 2016) [#13]
Well done!


RustyKristi(Posted 2016) [#14]
Hey AquaLung. Some thoughts and maybe a request for the BlitzMax wrapper, I think it would be nice if you can make it link to static shared library, since Irrlicht and BlitzMax are both crossplatform. It would be a waste if it only works on Windows with the DLL wrapper. :-)

thanks again.


AquaLung(Posted 2016) [#15]
@RustyKristi

I agree. I just don't have any spare time, any time I do get, I do a little work on a B3D game I'm making, just for fun. That's why I released the source code for the wrapper. Hope someone else has time to improve it.


RustyKristi(Posted 2016) [#16]
Ok thanks, it's all good and thanks again for sharing. Now I'm curious on what game are you working on with Irrlicht ;-)


Rick Nasher(Posted 2016) [#17]
I second that. :-)


Guy Fawkes(Posted 2016) [#18]
I third that! =)

~GF


AquaLung(Posted 2016) [#19]
Back when I began working on this irrlicht wrapper, I only had the blitz3D demo. After the free release of blitz3D, I decided to see if I could write a complete playable game. Back in the 80's, I did several partial games on the c64, learning to code in both basic and assembler. I never did fully complete a game. Since the wrapper is still imature, I decided to first attempt a complete game with blitz itself. I like to code, but I am no artist. I have been recycling older free and paid model packs I had from FPS creator and other free model sites. My game is a spinoff of a survival game like RUST, but with building blocks like 7 Days. The name I have come up with is S.C.U.D. (Survive, Craft, Unify, Defend). I wrote a new wrapper for the last released version of Raknet, 4.081 I believe. I first attempted this with the latest version of ENET, but connections were very unstable across the Internet, seemed to work ok on LAN though. My RAKnet wrapper is more like a Raknet for dummies, you don't have to deal with all the specifics of interfaces, you just start a Server or Client and then send packets back and fourth. All the specifics are handled within the wrapper itself. Tomorrow, I can post a couple of screen shots of what I have so far. Maybe SCUD II will be written using irrlicht :).


RustyKristi(Posted 2016) [#20]
That is really a cool project! hope we can get to see it in action soon :D


AquaLung(Posted 2016) [#21]
Added a few screen shots in my previous post.

AquaLung


Rick Nasher(Posted 2016) [#22]
Very, very c00l!!! Reminds me of Stranded(which I loved), but on steroids with a lot more heavy action and different more exiting gameplay.

Btw: I'm very interested in your 'RAKnet wrapper' for as it is for dummies then I'm your target audience.. ;-)

I'm trying to do a different type of multiplayer game for myself and a working example for the Blitz3d community for some time now, but so far had a lot of trouble getting it to work reliable enough. So if you care to publish/share I'd be much obliged. My goal is actually to be able to offer several networking options to the user but mainly host switching on the fly(if possible). Flanker created an UDP library for it, which is great, but I believe it has some reliability issues here and there. He's willing but unfortunately too busy right now with other projects to do version 2, so it's kinda tricky to get things to work as intended. :-(

So if yours is working properly I'd love to try it.


AquaLung(Posted 2016) [#23]
@Rick
The Raknet wrapper is not really ready for release, I modify it as I go, to work with my games needs. It is currently tailored as Server\Client model (Clients or Peers do not talk directly with each other, everything is relayed through the Server), not peer to peer with host migration. But, if your still interested, I can make it available to you to play around with...

Let me know.

AquaLung


RemiD(Posted 2016) [#24]
@AquaLung>>This looks good, curious to see more or to play a demo :)


@Rick>>As i already explained, if your multi players game does not work well with text/binary files on the same computer (as if each file was a packet) it will never work well with UDP !


AquaLung(Posted 2016) [#25]
I am currently creating the container\inventory management system and improving the animal AI system. It gets kinda complicated because the Clients just attempt to do and send requests, the server is master manager and is the authoritative decision maker. This is everything from player movement, player stats, animal movement and AI, building, crafting, collecting resources including chopping down trees and mining the stones and inventory management. Everything has to be split up just right between the Server and Client. The game will be free and I will also be sharing a dedicated server so anyone could host their own private\public server.

It may be some time yet...... :(

AquaLung


Rick Nasher(Posted 2016) [#26]
@AquaLung
Still interested of course! :-) And: can't wait to see what your game will be like eventually, but understandable it will take time.

@RemiD
I got your remark the first time(or I must have misunderstood), but as you didn't test the UDP library and coding examples yet, I tried also to explain that it *is* working, but not flawless, which could be due to the nature of UDP, the library or more likely, my bad programing.

If it's possible under Unity, it should also be available for us Blitzers is the philosophy and goal.


RemiD(Posted 2016) [#27]
Ok ok, this was just a suggestion.


Rick Nasher(Posted 2016) [#28]
@RemiD
No problem, can surely handle constructive criticism(and I'm sure you can for you are a probably a better coder than I am) if you would run the code and give your verdict, but if not done yet then how you know what's going on precisely eh?(I'd actually prefer you to check it but I know you said you don't want to get sucked in and enjoy the summer outdoors) ;-)
But no worries I'm not offended or something.


RemiD(Posted 2016) [#29]

if you would run the code and give your verdict, but if not done yet then how you know what's going on precisely eh?


My intent was not to criticize what you have coded, but rather to explain a way to create a multi players game and debug it easily on only one computer (writing/reading files, each file being like a packet), until it is bug free and reliable, because you assume that UDP or that Flanker's functions are not reliable, but are you sure that the problem is not your multi players logic ? That's all. Do what you want with this advice.


Rick Nasher(Posted 2016) [#30]
I'm indeed not sure it's a logic issue, that's why I'm rethinking this.


JapaneseGameDev3000(Posted 2016) [#31]
Can I port a game to mac using this and is it the same Blitz3D syntax as with just directx7 normal Blitz3D AquaLung? I must say, you have have done a great service to the blitz and game dev community by working on this.


RustyKristi(Posted 2016) [#32]
@AquaLung

Good stuff! also interested in what you have made with Raknet.


@JapaneseGameDev3000

You have to use the blitzmax wrapper and not the blitz3d userlib.


RemiD(Posted 2016) [#33]
Has anybody done some tests with the stencil shadows of Irrlicht ?

if yes, can you please briefly explain :
1)is it possible to have one light in one zone/room, and that the shadows casted by this light do not go through walls (in others zones/rooms)

2)is it possible to have several lights in separate zones/rooms (one light per zone/room), and that the shadows casted in one zone/room do no go through walls (in others zones/rooms)

3)is it possible to have several lights in the same zone/room ?
if yes, if a light is in the shadows casted from another light, does this shadow still exist ?
if yes, how is it blended with the color of the light ?
if no, how 2 shadows casted by the same caster (but from 2 different lights) are "merged" ?


Rick Nasher(Posted 2016) [#34]
Not paid attention to it(yet) for was/am too busy.
But now I'm intrigued and curious by your questions to see if it can do these things, for that would really be good..

This was a combination of the examples I tried when the first version of the wrapper was released by Aqualung(in 2014) and it appears that in this example using BSP trees, the shadows get projected on the walls but under certain circumstances do go through them.




RemiD(Posted 2016) [#35]

the shadows get projected on the walls but under certain circumstances do go through them.


i am not surprised, it is not easy to merge/mix stencil shadows with different lights in the same zone/room (severance did it, deus ex invisible war did it, but i don't know how)...

So for now i will focus on one light per zone/room, but be able to render several zones/rooms at the same time (each one with its own light and shadows)

Thanks for the infos.


Rick Nasher(Posted 2016) [#36]
So basically to be able to have shadows inside buildings it means you'd have to have very thick walls/adjusted geometry? That severely limits it's usability.


RemiD(Posted 2016) [#37]

to be able to have shadows inside buildings it means you'd have to have very thick walls/adjusted geometry?


no, it means you need to have a stencil shadows system which allows to render one zone at a time (with one light per zone, and casters/receivers only used for one zone) so that shadows don't go on unwanted zones.

Walls have nothing to do with that, you could have several zones in a terrain or even in a big room, i used the word room to better illustrate what i meant, but a zone is really what i meant.


AquaLung(Posted 2016) [#38]
Well guys, it's not really ready for release so I will share it here for anyone who wants to play around with it. Still developing it, along with the needs of my game. Based around SERVER\CLIENT model, CLIENTS talk to the SERVER, SERVER can talk to any\all CLIENTS. This is compiled with VS2015 so if you have not installed the 2015 redistributable then do so from first post. There is no documentation yet so reference the RN-Lib.decls and the RN-Lib.bb include file for help. There is a simple example, well more like test code, that I use to test data integrity and such, while adding functions to the lib. Just run a server and then run a couple of more times as client with different name. From the focused window, you can press <ENTER> or <SPACE> for different types of message tests, nothing great at all. :(

(RAKNET FOR DUMMIES SHARE 08/02/2016)
RN-Lib 1.0.0.2 for BLITZ (Raknet 4.081)


OculusVR RakNet 4.081


RustyKristi(Posted 2016) [#39]
this is interesting AquaLung! thanks for sharing. I know this is too early but as you are using RakNet, I would really like to see some NAT Punchthrough and Host Migration examples as this is really a few of the raknet's main features.

works ok btw, just tested on one computer though.


AquaLung(Posted 2016) [#40]
Yes, I hope to add a lot of the Raknet features.


RustyKristi(Posted 2016) [#41]
Great to hear! :) The reason being is unless you're concerned about IPv6 which also raknet supports, I don't see the need of using an external library like raknet if you're not fully taking advantage of what it offers, particularly using the latest which you indicate is 4.081 right there.


RustyKristi(Posted 2016) [#42]
Another issue I would like to brought up is about IrrkLang which needs licensing. Do you have any plans to replace it with a more permissive sound library? Say OpenAL, SoLoud or any library that you know or have used with irrlicht?


AquaLung(Posted 2016) [#43]
The source code was released with the wrapper, you can removed the Irrklang references and re-compile to exclude it. If I ever get time to work more on it, I would definitely like to replace it with some other open source sound library.

AquaLung


.


Rick Nasher(Posted 2016) [#44]
Yep, just tried it: working fine here(win10Pro x64, Blitz3d 1.106).


AquaLung(Posted 2016) [#45]
Here is a quick (and rough) breakdown of the current commands:

* Remember when retrieving data from a message, it must be done in the same order that is was sent else you WILL get corrupt data!!! There is NO error checking for this!

----------------------------------------------------------
Ex.
SENDING END.....
RN_SendByte( ID_CHAT )
RN_SendInt( 999 )
RN_SendString( "SERVER" )
RN_SendString( "BROADCAST MESSAGE" )
RN_SendMessage( RN_BROADCAST, RN_MEDIUM_PRIORITY, RN_RELIABLE, 0, True )

RECEIVING END.....
mymsg% = RN_GetByte()
myint% = RN_GetInt()
mystring1$ = RN_GetString()
mystring2$ = RN_GetString()
----------------------------------------------------------


Current RN-Lib.dll COMMANDS

RN_GetVersion$()
- Returns the Wrapper Version

RN_Initialize%()
- Initializes Wrapper, needed for both Server and Client.
Returns TRUE or FALSE.

RN_StartServer%(maxConnections%,localPort%,password$)
- Attempt to start as Server
Returns TRUE or FALSE. Will return -1 if Raknet itself fails to startup Server.

RN_StartClient%()
- Attempt to start as client
Returns TRUE or FALSE. Will return -1 if Raknet itself fails to startup Client.

RN_Connect%(host$,remotePort%,password$,blocking%)
- For Client, attempts to connect to a server, if blocking is TRUE, program will wait for connection message else you must process yourself
Returns TRUE or FALSE, if blocking is FALSE, this will return TRUE always

RN_CloseConnection%(notify%)
- For Client, closes current connection
Returns TRUE or FALSE.

RN_Shutdown%(waitTime%)
- Shutdown Raknet\Wrapper
Returns TRUE or FALSE.

RN_CheckMessages%()
- Check Message Queue
Returns TRUE or FALSE.

RN_ClearMessage%()
- Clears the current Message from the receive queue
Returns TRUE or FALSE.

RN_ForwardMessage%()
- For Server, forwards a received Message
Returns TRUE or FALSE.

RN_DisconnectPlayer%(playerID%,notify%)
- For Server, disconnects a player
Returns TRUE or FALSE.

RN_GetPlayerID%()
- For Server, returns Player ID for current Message
Returns 1 or greater for player ID or FALSE for failure

RN_GetTotalConnections%()
- For Server, returns current connected player count
Returns current total connections.

RN_GetTime%()
- Returns Raknet internal clock

RN_IsActive%()
- Returns if wrapper is currently initialized
Returns TRUE or FALSE

RN_PingHost%(host$,port%)
- Not completed yet

RN_GetAveragePing%(playerID%)
- For Server, returns average ping for specified player

RN_GetLastPing%(playerID%)
- For Server, returns last ping for specified player

RN_GetLowestPing%(playerID%)
- For Server, returns specified players lowest ping

RN_AddToBanList(ip$,ms%)
- For Server, Adds an IP Address to the BAN LIST

RN_RemoveFromBanList(ip$)
- For Server, removes and IP Address from the BAN LIST

RN_ClearBanList()
- For Server, clears the internal BAN LIST

RN_IsBanned%(ip$)
- For Server, check if a specific IP Address is currently BANNED
Returns TRUE or FALSE

RN_SendMessage%(playerID%,priority%,reliability%,channel%,broadcast%)
- Send current message
Returns Raknet's Result.


ADD Data to outgoing message

RN_SendTimeStamp()
- Add this immediately after Message Type (RN_SendByte) when you want a timestamped message

RN_SendByte(input%)
- Send Byte Data

RN_SendInt(input%)
- Send integer data

RN_SendFloat(input#)
- Send float data

RN_SendString(input$)
- Send a string of data (* Max length of 254)



GET Data from incoming message

RN_GetTimeStamp%()
- Returns translated timestamp of current message, this is cleard with the message (RN_ClearMessage)

RN_GetByte%()
- Returns a Byte of data from current message

RN_GetInt%()
- Returns an Integer of data from current message

RN_GetFloat#()
- Returns a float of data from current message

RN_GetString$()
- Returns a String of data from current message


RustyKristi(Posted 2016) [#46]
The source code was released with the wrapper, you can removed the Irrklang references and re-compile to exclude it. If I ever get time to work more on it, I would definitely like to replace it with some other open source sound library.


sounds great! thanks for hearing out my suggestion. :D


RustyKristi(Posted 2016) [#47]
Since your wrapper is still in early version, I was also wondering why you have not considered updating repeatuntil's version which is opensource and the commands are almost complete. I think that just needs proper docs, newer version (it's currently raknet 3.x) and good examples.

http://repeatuntil.free.fr/raknet/

Development version (Windows only), not updated to RakNet 3.82 (but still useful for those who wants to improve the wrapper): download.


The host migration and other useful functions are also in place in this wrapper version, it just needs proper examples.


AquaLung(Posted 2016) [#48]
Not sure if you ever used k-net, a direct play library for blitz. I wanted to build a Raknet wrapper as easy to use as k-net since direct play is way outdated. With simple commands, handling all the Raknet peer interface stuff within the wrapper itself. Repeatuntil's wrapper is great if you need to deal with all the specifics. I just want a simpler wrapper interface.


RustyKristi(Posted 2016) [#49]
Not sure if you ever used k-net, a direct play library for blitz. I wanted to build a Raknet wrapper as easy to use as k-net since direct play is way outdated. With simple commands, handling all the Raknet peer interface stuff within the wrapper itself. Repeatuntil's wrapper is great if you need to deal with all the specifics. I just want a simpler wrapper interface.



Ah ok understood. I have not tried k-net, just other dplay stuff here. BTW, just a side note though, I don't think directplay is really outdated, it's just MS decision to do so, just like early phasing out support for their stable os/software like Windows 7 (2020). It still works on Win 10 (as legacy option install)

I've seen a lot of games in Steam that only uses DirectPlay and commercial games like RiseOfNations Extended Edition which ironically is Microsoft as one of main Publishers.

Anyway, big kudos for this double project. the updated Irrlicht opensource port is really outstanding on its own and with the addition of raknet would just be a bonus.


Rick Nasher(Posted 2016) [#50]
Looks interesting enough, plenty of potential. Do you have a simple 3d usage example?
BTW, I stumbled upon this:

Would be pretty cool if could have a Blitz3d version of this.
Unfortunately the link to a more detailed view is dead.


AquaLung(Posted 2016) [#51]
Very cool, I like it...

No 3D example yet......


RustyKristi(Posted 2016) [#52]
Hey Aqualung,

I was wondering if you can still find the time to extend the wrapper and make it B3D command compatible. There are a lot of examples in this forum and archives that needs that updated graphics touch like what irrlicht can offer with DX9 and OpenGL.

Not to compare, but the SoftPixel Engine wrapper does exactly that with wrap commands with almost no changes at all in code plus its additional engine features like shader support, the problem is some notable commands like AlignToVector and some Entity functions don't seem to work like it supposed to.

I thought maybe you can have a look at it and could check it out. Thanks


AquaLung(Posted 2016) [#53]
No time currently, between work and family, any spare time I get, I relax and spend time coding my game.


RustyKristi(Posted 2016) [#54]
Ok no problem, I hope I'm not imposing it's just a suggestion. thanks