3D Canvas Community
3D Canvas Discussion Forums
General Off Topic Discussion
Blitz tutorial/starter|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Member |
I don't know if there is any interest in a Blitz3D beinners tutorial but just in case here's part one.
If there is any interest I will continue with further instalments, but as they are a bit time consumming to produce please post if you would like to see more. I'm assumming you haven't used Blitz before so I will try to keep things as simple as possible. If you are a seasoned Blitz user please feel free to add any comments/code suggestions you wish. If you haven't done any coding before, don't be put off, read on. Why use Blitz3D... Blitz allows you to bring together all your 3DC models,animations etc and create, if you wish, massive scenes, game levels, sims, cartoons, demo's, video clips etc. If you have any knowledge of a BASIC programming language you will find Blitz very easy to pick up. If you haven't, now is a good time to start. What is Blitz3D... If you visit the Blitz site, you will be informed that it is thier flagship Games programming software. What isn't mentioned, is that, following the developement over the last couple of years, Blitz has developed into far more than a programming language just for games. I know I'm repeating bits from other posts here but you can now write, if you wish, your very own 3D modeller, Paint programm, Landscape Genorater, Lightmapper/Renderer etc..etc.... You can generate a .exe file of your finished product which will run on computers that don't have Blitz installed. What do you need... First the demo version of Blitz 3D, it's free and you can get it here under Products... http://blitzbasic.com/ 3DC and some form of decent paint/image editing software you should already have Thats all you need to get started, as you progress there are other tools which can help you produce profesional quality Apps/Games/Sims. For now just stick with the above. All the commands are not included with demo and you are limited to a .bb file size of about 12k. Problems... These are all mine you will be pleased to hear. I need to keep the file sizes within the forum limit of 80k, this could be a bit of a headache, especially if textures are included but I'll see what I can come up with. Again, please post if you would like me to take this further. Bazza This message has been edited. Last edited by: Bazza, Mrs Bazza says "just keep taking the tablets dear, and everything will be OK" |
||
|
|
Member |
Part1....
To start off I've chosen a very simple Quake style game scene. Although the way the camera moves is exactly the same in my railway sim. The code is as short as I can make it but it will give you some idea of how to set things up and move around a scene. Don't bother to try and understand the code in the Main Game loop, I'll explain it later. This just restricts the frames per second in such a way that it should run the same an any PC. Unless of course your PC is so old it can't maintain the 30 FPS I've set it to. If thats the case you wouldn't be able to run 3DC either. I've documented the code but if anyone has any questions just ask. Hopefully I will know the answere. If you try changing or adding your own code and start getting error messages, go into De-Bug mode. This will usually indicate the line of code that is causing the problem. Remember to vist the Blitz forums where you will find answers to most of your questions, also the Code Archives. INSTRUCTIONS. 1) Create a new folder in your main Blitz directory and call it "MY_GAMES". 2) In your MY GAMES folder open another folder called "MY_GameOne". Choose your own folder names if you wish. 3) Unzip the attached file, Part1.zip to your My_GameOne folder. You can't run it from the zipped folder You can then load the file GameShell-1 either by double clicking the file or by opening Blitz and use the Open file in the FILE Menu, then select 'Run' from the Program menu or click the Red arrow icon next to the House icon. Move around scene with the arrow keys. To move up and down use the Home and End keys above the arrow keys. To exit press Esc key. I havn't included any collision detection so at the moment to can walk through walls etc. I made the scene quickly with 3DC using just two cubes and exported it to the models folder as Scene1 .x Remember all your models and textures must be in the same folder. Use the textures as you wish. Before changing anything, use the SaveAs... option in Bltz to save the file under another name then you can always go back to the original if you make a blunder. If you click on 'help' and then select Command reference it will list all the commands you can use. You use both 2D and 3D commands in a 3D game/app but only the 2D commands in a 2D game/app. Try loading some models of your own into the scene and use the x, y, z camera posiotion as a guide to positioning them. Try changing the ambient light colour and see what effects you can get. I build my models in 3DC to a 'real world' scale of 1 meter = 1 meter in 3DC. This scene was scaled in x,y,z by 4 when I loaded it into Blitz, so if you do load in any of your own models use the same scale and everything should fit. Try something simple to start with, build a 1 meter x 1 meter x 1 meter wooden crate in 3DC, export as Crate.x to the models folder and then try and load it into the scene. Make sure the texture you use for the crate is also in the models folder. Bazza This message has been edited. Last edited by: Bazza, Mrs Bazza says "just keep taking the tablets dear, and everything will be OK" Part1.zip (66 Kb, 379 downloads) |
|||
|
|
Member |
Hi bazza
First off, thanks for posting this I started something like this before using darkBasic. I learned quite alot, had a scene loaded with other object and animations in it too Models were not placed where I wanted them to be, although everything was fine starting off. Everything just started to get a bit confusing, so I (threw?) my hat at it. After saying all that, I'm willing to give it another shot - with blitz - maybe with a little help from yourself. So I'll follow you on this one sir! I've installed the demo of blitz and loaded up your "gameshell" file and made some changes of my own, just a few and saved as "mygame" 'Till then... I'm waiting for orders James |
|||
|
|
Member |
Hi James
Pleased your interested, I thought I was wasting my time. Luckily I was just working on Part 2 when I saw your post so here's a sneak preview. It now includes collision detection between the camera pivot and the scene and I've put a new line of code in the main loop...TranslateEntity campivot, 0,-.4,0 This pushes the camera pivot into contact with the floor all the time, even without a keypress. Be careful with this and the collision detection if you change the scene for your own, you must make sure the camera is positioned inside the scene or you will just drift off into space. To de-activate the collision detection just put a comment ( a semi-colon) in front of the following line of code.. Collisions Camera_col,Scene_col,2,2 Try this and see what happens, you will see what I mean about drifting off into space To stop this put a comment in front of the line... TranslateEntity campivot, 0,-.4,0 I'm just messing around with this scene at the moment. I havn't finished building all the rooms yet, as you will see. And in one part you can walk off the edge of a corridoor and drift into space. I've just applied my usual wall/floor textures as a test to get some idea of the scale of things in Blitz. I'll change these later. If you have something specific you would like to do with Blitz just let me know, also take a look at the space demo file, it will give you some idea on how to make intro's/video clips etc. Who knows...this time next year you could be doing the opening sequence to ALIEN 9. I hope you can get back into coding, it makes all the difference to be able to 'do' something with the models you produce. IMO Anyway unzip the file Part2.zip into your MY_GAMES folder and take a look. Let me know what you think. Maybe if others where interested we could get some form of community project going. It doesn't have to be a game, any ideas anybody? Is there any docs with the Blitz demo saying what the restrictions are? Bazza Mrs Bazza says "just keep taking the tablets dear, and everything will be OK" Part2.zip (69 Kb, 231 downloads) |
|||
|
|
Member |
Excellent
I,m gonna load up part2 now, study it for a while and see whats happeing. Collision detection already James |
|||
|
|
Member |
Well this is it, 'The Full Monty', The full level shell.
First the files. Unzip Part3.zip to your MY_GAMES folder. Bazza Mrs Bazza says "just keep taking the tablets dear, and everything will be OK" Part3.zip (74 Kb, 227 downloads) |
|||
|
|
Member |
Next the 3DC file.
Unzip this to the Part3 model folder. I couldn't include the textures but they are in the Part3 model folder anyway. I've included 2 dummy walls that can easily be removed if you wish to extend the level. Bazza Mrs Bazza says "just keep taking the tablets dear, and everything will be OK" 3DCscene.zip (35 Kb, 216 downloads) |
|||
|
|
Member |
This is whats new....
I've completed the level, and added some stairs. This is now the basic shell I will be using in the future so if you can leave the scene1.x file and the Gameshell-1.bb file as they are, We can work with the same files. This will make things much easier.... I can just write the new code and only have to add the new models. The Home and End keys now let you LOOK up and down instead of MOVING up and down. Just load the Gameshell file and save it under another name in a different folder remembering to copy the models folder also. THEN you can play with it. The same goes for the 3DC file. I,ve included it so you can extend it if you wish. BUT under another name!!!!!! I'll try and get something to interact with next...sliding doors or lift maybe. First though I'll start a Blitz Hints and tips thread, I think that would be more helpful. PLEASE add to it if you wish. Although I've desribed this as a gameshell, you could just as easily use it for any kind of walkthru demo thingie. Say, your favorite Gothic Cathedral or your own house if you wish, the priciples are the same. Enjoy it, let me know what you think and if you have any questions just post or send me a PM if your desperate. Bazza This message has been edited. Last edited by: Bazza, Mrs Bazza says "just keep taking the tablets dear, and everything will be OK" |
|||
|
|
Member |
Just to give you some idea of what you can achieve I loaded the scene into Gile[s] for a test render and it lasted two hours.
Just 540 polys and two textures. Sorry four textures I forgot about the lamps. You won't be able to get this sort of a result with just DX lighting, you need a lightmapper. But it just goes to show that with just three programms, 3DCanvas, Blitz and Gile[s] you can create some great looking demo's ect. Bazza. Mrs Bazza says "just keep taking the tablets dear, and everything will be OK" Chamber.jpg (61 Kb, 521 downloads) |
|||
|
|
Member |
The main room.
Mrs Bazza says "just keep taking the tablets dear, and everything will be OK" Room.jpg (59 Kb, 412 downloads) |
|||
|
|
Member |
One of the corridor areas.
Bazza Mrs Bazza says "just keep taking the tablets dear, and everything will be OK" Corrodor.jpg (60 Kb, 401 downloads) |
|||
|
|
Member |
Gee! Thanks for all this help bazza
I've down loaded the files and will take alook shortly. Just before I came back to these forums to check for updates, I was thinking the same thing, adding stairs. And then I was thinking.. but how will I get to walk up these, so to speak (because of the collision with the steps). Then I thought that, modelling a kind of curvey object, sloping it to the angle of the steps and slapping a 100% translucency (map)? on it. Those renders look great too!! It would be great if you cuold get that kind of lighting in Blitz. I might have a gander at Giles... for the moment I'll have enough to do Thanks anyways. Off to play James |
|||
|
|
Member |
Hi James,
quote: You can, but you would need the full version of Blitz. Then you can export the scene from Gile[s] as you see it here and load it into Blitz with the lightmap. I don't think anyone uses DX lighing much now especially for games. Remember there is a limit to the number of DX lights you can have...normally 8 but some graphics cards allow 16. However each light also slows things down a bit..so take it easy. Another good reason for using a lightmapper Re the stairs... Thats one way of dealing with stairs and exactly what I've done in this case. Rather than apply a texture with 100% translusency I just apply a small colour texture, (in this case yellow) and then load the ramp into Blitz, positon it and then set the EntityAlpha for the ramp to zero. See..... Ramp=LoadMesh("models/ramp.x") If you put a comment before the line.... EntityAlpha Ramp,0 You will be able to see the ramp in Blitz. Try setting the alpha to .5 and see the effect, you can use anything between 0 and 1. You must be careful not to make your stairs/ramp to steep. Nothing over 45 degrees. The camera pivot is constantly being pushed down with the command.....TranslateEntity Campivot, 0, -.04, 0. So when you hit a ramp you have two things happening... 1) You are moving forward with....MoveEntity Campivot, 0, 0, .5 2) But the TranslateEntity command is pushing you down, so you will slow down going up a ramp. No doubt you have noticed this. Also the relationship between the forward movement and downward pressure is important. If you set the downward pressure to high, when you try to climb the stairs, it will be pulling you back down again. About 50% seems right ie....forward z movement =.5 downward y presure = -.25 I'ts a bit like real life really...the steeper the slope, the harder it is to get up. You can use this to your advantage in a game, ie..... The player activates some kind of device which will explode in 30 seconds...you block of all exits except for a steepish ramp and the player has to negotiate this within the 30 seconds. You can take this one step further. In this version I changed the Line... Collisions Camera_col,scene_col,2,2 but forgot to change the comments so they are incorrect. Instead of 2,2 at the end it now reads 2,3 Try changing this back to 2,2 You will now find that if you walk onto the stair/ramp and take your finger off the forward arrow key you will slide back down the slope. This is called a full sliding collision as against 2,3 which is the same thing without the slide. So, by using this type of collision, your player would now be trying to negotiate the slope in less than 30seconds but would slide back every time he released the forward arrow key. All you need to do is to add some kind of booby-trap thingies on the slope and you have one of those annoying bits of game play that seem to take forever to get out of. I call this "slowing things down".....a few things like this, even in a small level can make it last a lot longer and they are easy to create. I'm going to have a go at the Hints & Tips thread now so will start with collision detection and my favorite commands..... HideEntity....ShowEntity Did you get my PM? Bazza This message has been edited. Last edited by: Bazza, Mrs Bazza says "just keep taking the tablets dear, and everything will be OK" |
|||
|
|
Member |
bazza
I'm injoying this. I think blitz might be abit friendlier than darkBasic? or maybe I'm actualy starting to remember/understand this stuff a little better this time 'round. I've played with the code 'till 6 in the morning quote: You can, but you would need the full version of Blitz. How many can you have with the demo? quote: Thats one way of dealing with stairs...set the EntityAlpha for the ramp to zero. This is brobabobabubly the better way to do it, because when I tried it my way, the ramp wasn't invisible, even though I'd already placed a glass window into the scene and it work ed ok quote: You must be careful not to make your stairs/ramp to steep. Nothing over 45 degrees. The camera pivot is constantly being pushed down with the command.....TranslateEntity Campivot, 0, -.04, 0. So when you hit a ramp you have two things happening... I see now fight, fight, Thanks again bazza. I'm off to add afew thing to my scene/level. I'm sure I'll be back with more quests. James |
|||
|
|
Member |
Blitz does seem to be easier to use than DarkBasic, so I'm reliably informed by people in the know. I've never used Dark Basic so I'm not really in a position to comment.
6 am thats some session You can use up to 8 lights with the demo. I'll take a look at setting the transparency in 3DC and see if I can sort that one for you. If you decide to purchase the full version I'll send you the lightmapped level. Bazza Mrs Bazza says "just keep taking the tablets dear, and everything will be OK" |
|||
|
|
Member |
I think I've sorted the transparency problem.
If you set the translucancy in 3DC to 99% and then export to Blitz you get a fully transparent object. However if you set the translucancy to 100% in 3DC you get a fully visible object in Blitz. Strange. You must apply the translucancy to a texture not just to a colour. Bazza Mrs Bazza says "just keep taking the tablets dear, and everything will be OK" |
|||
|
|
Member |
Thanks, I was thinking this myself.
I'll try this and see how I get on. |
|||
|
|
Member |
Yes this worked
|
|||
|
|
Member |
Don't stop posting the tutorials, they are a great source of information for us. I've overloaded myself with learning different programs and sometimes it's a bit hard to sort out the differences between them. Thanks for all of the hard work you've put into them!!
Richard T. "I'm that other Richard..." "You can get the h**l out of Texas, but you can't get Texas outta you!" |
|||
|
|
Member |
Thanks Richard,
When I get this shooting thing out of the way I'm going to do an aircraft demo. looping the loop etc. But I don't think my aircraft will look anywhere near as good as yours..it will just have to be a basic shape. Bazza Mrs Bazza says "just keep taking the tablets dear, and everything will be OK" |
|||
|
| Previous Topic | Next Topic | powered by eve community | Page 1 2 |
| Please Wait. Your request is being processed... |
|
3D Canvas Community
3D Canvas Discussion Forums
General Off Topic Discussion
Blitz tutorial/starter