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.

DarkBASIC Professional Discussion / Loading FPSC level WITH Entities

Author
Message
Anigma
15
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 6th Jun 2012 00:43
Hi gang,

Before I spend the better part of a day digging around in the FPSC source code, I thought I might ask if anyone here has already invented the wheel I need. Does anyone have DBPro code that will load an FPSC level, plus all the dynamic entities (doors, baddies, health packs, etc) and plop the player on player start? I don't need it to run FPI scripts or any of that - I will be creating my own code to deal with moving enemies around and opening doors and that sort of thing. I just need it to load the level and have the entities show up in the same places I've parked them in the map editor.

If not, I will try my hand at writing it and if successful I'll share with the community as I'm sure it would make a good starting point for all sorts of projects.

Thanks,
-Anigma

It compiled! Ship it!
Daniel wright 2311
User Banned
Posted: 6th Jun 2012 00:50
As you can load in fpsc maps easy,you can not load in dynamic entities from fpsc.

You have to load in each object in your code into the loaded .dbo file then position them.

my signature keeps being erased by a mod So this is my new signature.
Red Eye
17
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 6th Jun 2012 01:03 Edited at: 6th Jun 2012 01:03
@Daniel wright 2311: Who told you that? I have done it...

.FPM are nothing more than zip files, it contains all the files you need to be able to load static and dynamic data.

Cheers,

Anigma
15
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 6th Jun 2012 01:04
Quote: "As you can load in fpsc maps easy,you can not load in dynamic entities from fpsc.

You have to load in each object in your code into the loaded .dbo file then position them."


Well, since FPSC is written in DBPro I know it can be done, just not easily - I've perused the FPSC source code and followed the little white rabbit down the hole of nested subroutines that do it. What a long, strange trip that was. Guess it'll be up to me to do it, so hopefully tomorrow I'll have something that works to share, unless someone else beats me to it.

Thanks again,
-Anigma

It compiled! Ship it!
Daniel wright 2311
User Banned
Posted: 6th Jun 2012 01:08
Quote: "FPM are nothing more than zip files, it contains all the files you need to be able to load static and dynamic data."


then show us all how to open them then load them into the map

my signature keeps being erased by a mod So this is my new signature.
Red Eye
17
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 6th Jun 2012 01:17 Edited at: 6th Jun 2012 01:23
@Daniel wright 2311:
Don't know if interested or just plain sceptic.


Either way, I am happy to guide any that want to load in dynamic data.

Couple of tips:

.ele files contain data saved by the Map Editor
.ent files contain data with paths to the fpe or bin files of the different models used ( this is mainly important for start offsets and models path)
.lgt files contain light data
.way files contain all waypoint data

.ele files look something like this:
numOfEntities
ENTITYBLOCK
referenceToENT
x,y,z
etc

The referenceToEnt will tell you what .fpe fiels (models) belongs to this Entity. So if value 1 is read, you need the first path of the .ent file.

I actually read the whole source 1.13 and 1.17, to help me loading all the files through C++ into the LightStormEngine correctly, it does help, but in the end a couple of functions is really everything you need and makes you wonder why Lee programmed it like this and not just plain simple an XML file or something haha. You can search for .lgt .ent .way etc.

Cheers,

Daniel wright 2311
User Banned
Posted: 6th Jun 2012 01:40
interested indeed

my signature keeps being erased by a mod So this is my new signature.
Daniel wright 2311
User Banned
Posted: 6th Jun 2012 01:42 Edited at: 6th Jun 2012 02:05
what? never mind,odd double post there happened.

my signature keeps being erased by a mod So this is my new signature.
Anigma
15
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 6th Jun 2012 02:00
@redeye - Any chance you'd be willing to post those couple of functions? I'm poking around in the FPSC code now and again, I feel somewhat like Alice tumbling down the rabbit hole. I keep following all these gosubs and they are starting to blend together.

Even if it's C++ source, that would help. I know enough C++ to be dangerous. If not, I understand - I can plod along and try to figure this out on my own but as you said, Lee's code is a bit complex.

Thank you!

It compiled! Ship it!
Daniel wright 2311
User Banned
Posted: 6th Jun 2012 02:52
I am shure he will not,but if he does great,I been looking for this for 6 years now,I am shure its more then just a couple functions.

my signature keeps being erased by a mod So this is my new signature.
Anigma
15
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 6th Jun 2012 02:58
Hi Daniel, I've been wanting this for a long time too, so I'm determined to make it happen. I've got some free time tomorrow (and tonight as well) so I'm going to take a crack at it. I'll create a simple room with a Player Start, one door and one enemy, then try to load it in DBPro. The code for this is all there in the FPSC source, I just need to wrap my head around it and port it over to my own program. I do know that loading the static level geometry is quite simple, so all that leaves is the entities.

I may get lucky and have something for you tonight on this. Stay tuned...

It compiled! Ship it!
Daniel wright 2311
User Banned
Posted: 6th Jun 2012 03:38
cool, It will make my game so much easer to make,cant wait.

my signature keeps being erased by a mod So this is my new signature.
Anigma
15
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 6th Jun 2012 05:56
OK, built the simple level and figured out how to get the camera sitting on player start... this is going to take a while though. I'm not quite ready to post what I've got yet, but I should be by tomorrow.

-Anigma

It compiled! Ship it!
Daniel wright 2311
User Banned
Posted: 7th Jun 2012 01:42
Any good news?,If not I might be able to re down load the sorce code and look into it myself,but I did not want to do it as my time is small.

my signature keeps being erased by a mod So this is my new signature.
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 7th Jun 2012 01:56 Edited at: 7th Jun 2012 02:23
Withdrawn...


Twitter: @NFoxMedia
Daniel wright 2311
User Banned
Posted: 7th Jun 2012 02:01 Edited at: 7th Jun 2012 02:01
@BlackFox

why dont you just show us how you did it? It would save him and or me alot of time.Dont know why its such a hugh secret,if you ask me,its kind of childish to keep such a little thing from the whole comunity.

my signature keeps being erased by a mod So this is my new signature.
Red Eye
17
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 7th Jun 2012 03:41 Edited at: 7th Jun 2012 03:45
@Daniel wright 2311: Nah, figuring out cost me alot of time, I am not giving out my source code until LightStormEngine has reached a public release, I think that's kinda obvious. But I like to help, so if you run into any problems I will answer them, here or on msn:
.

This subroutine _entity_loadelementsdata: loads all dynamic data into memory. (only .ele, so if you want to have the subroutines that loads .ent and the others you can just search in the DBA Source File for: ".ent" or ".lgt")

Cheers,

BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 7th Jun 2012 03:57
Quote: "why dont you just show us how you did it? It would save him and or me alot of time.Dont know why its such a hugh secret,if you ask me,its kind of childish to keep such a little thing from the whole comunity."


Quote: "This subroutine _entity_loadelementsdata: loads all dynamic data into memory. (only .ele, so if you want to have the subroutines that loads .ent and the others you can just search in the DBA Source File for: ".ent" or ".lgt")"


Which is what I said in my previous post before your comment about being childish. Red Eye told you in his first post, as did I, where to look to do it. Had you been a bit more polite, I could have given a step-by-step, even though (like Red Eye) this is a development for our company and we are not willing to part with any code from our work just yet until it is completed.

I'm certain you will get it figured out.


Twitter: @NFoxMedia
Daniel wright 2311
User Banned
Posted: 7th Jun 2012 04:11 Edited at: 7th Jun 2012 04:13
I never said you or any one was childish,I said acting as such by not posting code,I ment no insults,so please forgive.

I know in the code snipplets there is code for almost everything,everything I can think of is in there,I can understand not relising code from a project being sold,I never thought of this till now,well,not fully.

Quote: "I'm certain you will get it figured out."


Yes I will figure it out,and when I do,there will be full code given out to all,just as I always do,if I can.

I have had 6 years to try to figutre it out,its time to stop being lazy and undulge my self into it.

Quote: "This subroutine _entity_loadelementsdata: "


Thank you,I will start there and look deep into it.

my signature keeps being erased by a mod So this is my new signature.
Anigma
15
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 7th Jun 2012 05:38 Edited at: 7th Jun 2012 05:40
Relax guys... I'm close. Here's what I have so far:



Left to do: Extract levels from zip file and link the entities to the appropriate DBO file in entityank and/or meshbank so that they can be loaded in their correct positions. Hopefully I will have some more time over the next few days to add that.

Enjoy,
-Anigma

It compiled! Ship it!
Daniel wright 2311
User Banned
Posted: 7th Jun 2012 06:08
Nice,good job,need help? let me know,I will do what I am able to.

my signature keeps being erased by a mod So this is my new signature.
Anigma
15
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 7th Jun 2012 08:21
Hi Daniel,

Sure, see if you can get the entities to appear. What I did for testing was create a simple room with a player start, one door, one static light and one character entity in it. I then did a final game build with that map as the first level (don't forget to set imageblockmode to 0 in your setup.ini first) and then extracted the contents of level1.zip into the testlevel folder - the password for the file is "mypassword". I then copied the Files folder to the same folder as my program and there you have it.

I got player start working, that was actually really easy once I had read the universe.ele file into an array. The key to the rest of it is the .bin files in entitybank. Those contain the information needed to load the meshes, texture them and apply effects. Once they're loaded, just match up the names in the entity array and that will give you the positions and angles to place them in the map. I should hopefully have that done in a couple of days if my schedule permits (unless of course you beat me to it).

Off to bed now... good luck!
-Anigma

It compiled! Ship it!
Daniel wright 2311
User Banned
Posted: 7th Jun 2012 08:35
Got it,I will get on it,thanks.

my signature keeps being erased by a mod So this is my new signature.
Ched80
15
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 8th Jun 2012 00:12
Great work guys! I might start putting together a small guide with all these FPSC to DBPro tutorials as they are really really useful.

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 8th Jun 2012 14:08 Edited at: 8th Jun 2012 14:10
Don't expect people to give code out if they don't want to.

Anigma
15
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 9th Jun 2012 03:26
Hi guys,

Success! I now have the code loading the door and character that I added to the level. I haven't tested it on larger levels yet, so it still may need some tweaks but here it is - there should be enough here to get anyone started who needs to load a level in DBPro with entities.



It's somewhat of a mess, once I test it on larger levels I'll clean it up and optimize it for more general use and readability.

Enjoy!
-Anigma

It compiled! Ship it!
Daniel wright 2311
User Banned
Posted: 9th Jun 2012 04:31 Edited at: 9th Jun 2012 04:32
Well,i could not get the zip file UN zipped,but I took that part out and just used the open folder in the level bank and it worked like a charm,I was close my self,NOT,THIS IS GREAT AND ABOUT TIME,I HAVE MANY MANY MANY PLANS WITHT THIS,I OPENED A HUGH LEVEL,ALL OD IT LOADED UP.

my signature keeps being erased by a mod So this is my new signature.
basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 9th Jun 2012 04:40
I never used FPS creators but I knew from the example projects that I can upload static objects to DBpro. the Idea came to me since couple of weeks that I can design the world with FPS creator then the game story in DBpro.

but my real question is, can we sell FPS compiles games on intel app store?

Anigma
15
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 9th Jun 2012 06:13
Hi Daniel,

Glad you like it! I wonder why the zip file part didn't work, though. I'm going to fiddle with this some more and see what's up with that.

I also need to read the weapons attached to the characters and load that up, so there's still more to come on this. I won't be happy with it until the characters are standing there with weapons in hand, waiting for my program to animate them. I need that for the many, many plans that *I* have for this.

Stay tuned!
-Anigma

It compiled! Ship it!
Anigma
15
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 9th Jun 2012 09:09
Hello again,

Here's the latest. I fixed a couple of bugs that I found when loading a larger level. I expanded the entity arrays from 100 to 999, and added a routine where the proper BIN file is found by the name of the entity in the map rather than just incrementing the entity ID. What this means is that you can NOT change the name of any entities you place in your map, or the code will ignore them.



Here you go guys. All that's left to do is load and place the weapons that the characters are carrying and of course clean up this code. Enjoy!

-Anigma

It compiled! Ship it!
zeroSlave
17
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 9th Jun 2012 11:11 Edited at: 9th Jun 2012 11:18
Instead of Dimming your array(999), you could just use a dynamic array list to store the data. Why limit the entity amount?! I'm also pretty sure that when you dim an array with an amount, it automatically allocates the memory used for the data. If it is set up dynamically, you can just add as you go.

Just DIM YourArray() then when you want to add data just use: ARRAY INSERT AT BOTTOM YourArray()
So something like:


If you wanted to go through the whole list and find the player's start position and the enemies, you could do something like:


What you've already accomplished is great! Just thought you might be interested in making it a bit more dynamic.

Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.
Ched80
15
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 19th Jun 2012 22:40
Just a short update.

I managed to get the dynamic arrays working:



Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
Anigma
15
Years of Service
User Offline
Joined: 25th Mar 2011
Location:
Posted: 21st Jun 2012 20:54
Hi Ched,

Thanks for adding that - much appreciated. I've been busy at work and with other things and have not had much time to work on this.

Currently my rail shooter is at a standstill due to a couple of problems - one solvable and one not (at least not easily). The solvable problem is an issue I'm noticing with some of the entities in my map. They seem to flicker, almost as if there is two of them occupying the same spot. That should be easily solved if so, and I'll be working on fixing that in the next iteration.

The other one is a bit thornier. I want to make a two player game and I had hoped to be able to use 2 mice as the input devices since I will eventually be adding two EMS Topgun 3's for the players to use (this is a special one off project to build an arcade console game in DBPro). Of course after I dream up my great idea I go perusing the internet for how to do it, only to learn that DBPro does not natively support 2 mice. Neither does Windows, really. I mean sure, you can have 20 mice connected if you want, but they all control the same mouse pointer. Duh. Hadn't thought of that....

My guess is that I will want to treat the EMS Topguns as joysticks rather than mice in my code, but until I get them, I don't know for sure. If anyone has ever used one, I'd love to hear how it worked and what you did in DBPro to use it.

More to come...
-Anigma

It compiled! Ship it!

Login to post a reply

Server time is: 2026-07-07 17:09:10
Your offset time is: 2026-07-07 17:09:10