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.

Newcomers DBPro Corner / DarkBasic FPS with fpsc?

Author
Message
GLaDOS
14
Years of Service
User Offline
Joined: 16th Jul 2009
Location: Italy
Posted: 19th Dec 2012 16:25 Edited at: 19th Dec 2012 16:27
Hello! i just saw a video on youtube where a guy made a darkbasic game with a fps creator map and fpsc entities, im new to darkbasic and i have a question:it is hard to make a simple fps with darkbasic with a fpsc map? Just a simple game where you have a gun and you shoot enemies
Thank you

~GLaDOS
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 19th Dec 2012 18:08
Pretty much easy based on how you code it... you could alternatively create your own map in MapScape (free) or 3DWS (paid) (ask if you are unfamiliar with these...)

Create your movement code and shooting code and use a collision library to calculate hits ...

Using a physics engine such as PHYSX (DarkPHYSICS) speeds things up a bit ... coding wise...

Ask away

GLaDOS
14
Years of Service
User Offline
Joined: 16th Jul 2009
Location: Italy
Posted: 19th Dec 2012 18:15
i Already Made my map with fps creator,loaded it in DBPro with the basic wasd movement but now i have no idea what to do.all i really want is just a enemy that shoots me,a health bar and a gun with ammo.Nothing to ambitious i think. Its that hard?

~GLaDOS
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 19th Dec 2012 18:46
Do some pseudo code and map it out

GLaDOS
14
Years of Service
User Offline
Joined: 16th Jul 2009
Location: Italy
Posted: 19th Dec 2012 18:49 Edited at: 19th Dec 2012 19:05
What? Sorry i dont understand
Edit:I Have one problem:I loaded the map from fpsc but all i get its a black screen.i tried with the one wich comes with darkbasic,same
Halp

~GLaDOS
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 19th Dec 2012 19:26
Do a search on Pseudo Code...

Did you disable automatic camera using... AUTOCAM OFF at the start of your code?

And also Sync?

If you do not mind, can you share your code here by copying it all and coming back here... click on the code button... paste the code below or after the code block and then click the code button again...

Then anybody can assist you in correctly setting up your scene

GLaDOS
14
Years of Service
User Offline
Joined: 16th Jul 2009
Location: Italy
Posted: 19th Dec 2012 19:31 Edited at: 19th Dec 2012 19:44
Mmmmmm actually the one from tgc works,but mine wont..maybe i coded something wrong? im gonna make a copy of the one from tgc and then put my scene and see if its me or the level
Edit: ok it works but the segments are invisible and i see everything messed up
Edit2: I cant find stuff about "Pseudo code"

~GLaDOS
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 19th Dec 2012 21:02
Pseudo code is basically...

setup screen
load objects
start main loop
run functions
call syncs
end loop
place end call here
functions go here
subroutines here


etc...

You can use the same for functions and then build the code for them...

29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 20th Dec 2012 00:35
@ GLaDOS

The best thing to do is load upload your project and then someone can have a look at it. It's easier to fix a problem if there's something for people to play with.

As for actually making your game, i think the essence of your problem is this:

Quote: "i have no idea what to do.all i really want is just a enemy that shoots me,a health bar and a gun with ammo"


Someone could just tell you how to do this but I'm kind of guessing that you want to learn to make bigger and better games. So this is my view and my advice, take it or not as you see fit.

The way I see it, there are two things going on here.

The first is what I would call the concept design stage. What you have so far is a vision for what you want the game to be. I think it's actually quite a good vision, brief and too the point. However, what you need to do is put some details in so you need to write down the details of what you want. For such a simple idea you don't need to spend too long doing this and will probably be no more than a page long.

This is the sort of thing I would probaby write:

1) Standard WASD and mouse FPS controls (you've already done this).
2) Player sliding collision against walls.
3) No jumping or crouching
4) There will be a cross hair in the centre of the screen.
5) Player only has a single weapon and there's no close combat.
6) Player uses left mouse button to shoot. Player's weapon is single shot so they must release the left mouse button and press again to fire another shot.
7) Enemies are static and always point at the player.
8) If the enemy has a clear line of sight they will immediately shoot at the player.
9) The enemy will fire a single shot, then there will be a delay of half second between shots.
10) There will be random element to simiulate the npc's shooting ability (to give the possibility that they might miss the player).
11) Bullets will not be visible and all hits will be decided by simple ray casting
12) There will a visual indicator to show that they npc is shooting (muzzle flash or whatever).
13) and so on (there is a whole bunch of other stuff you need to consider like how much damage does single shot do, when happens to the npc when they die etc)

This is just an example to show you the sorts of things you need to consider but what I've done is try to make it as simple as possible and it can always be expanded upon. However, I think it's important to write down things that you don't want as well as the things you do want, as this immediately clarifies any ambiguities.

The next stage:

This is the problem solving stage. By this I mean you look at each point in the list above (or you're equivalent of it) and work out how you're going to code each bit and how it's all going to work together. This is going to depend on how good you are at problem solving and turning ideas into code.

So, lets look at point number 5. What needs to happen in order to score a hit on an enemy is:

5.1) The cross hair needs to be on the enemy
5.2) The player presses the left mouse button.

So, how do you determine if the cross hair is on the enemy? There are a couple of ways but I would recommend using sparks collision dll and doing a ray cast. A ray cast requires a start and end point. So the start point can be the camera position (which you know). The end point is some distance away directly in front of the player. The actual distance will depend on the size of your map but should be at least the range of the camera (which by default is 3000 units away. Now the trick is, when exactly is the end point of this ray cast? This kind of question is the fine detail of game creation. There are many different ways of doing this and we still haven't gotten onto actually using the ray cast, we're just trying to define its end point. This is why I kept the game play as simple as possible because you're going have to go through this for everything in the game (to a greater or lesser extent depending on what you already know how to do).

I generally describe problem solving as a combination of knowledge, creative thinking and experimentation, wrapped up in methodical thinking. The knowledge part is about learning things, looking at example and demos (everything you want to do is somewhere on the forums). Creative thinking is a little more difficult to understand, I don't think many people get it. In this context it's not about art or graphics it's about thinking about things in a different way, making connection between what seems like disparate bits of knowledge and coming up with ideas. A good way of cultivating a creative mind is to come up with as many different ways of doing the same things. So for instance, how many ways can you think of to get a cube to move in on a circular path? I can think of at least three. Experimentation is another easy one to do. This is all about writing short and simple code to try out ideas. So if you've never done ray casting before, I would suggest just writing a simple bit of code using primitives and just explore how it all works. It's also easier to get help with small bits of code you can put in code box. The methodical thinking is absolutely crucial and is all about defining the problem and then planning out the solution. It helps to highlight areas where you lack knowledge and exactly what it is you need to do. The more you problem solve the easier it becomes but it really does take practice.

My intention is not to scare you off, what you want to do is fairly easy and you're bound to find examples on the forums. But even if you find something you still need to understand it enough to bring into your code. And if you want to expand your game, you're going to very quickly stumble into some potentially complicated problems. My advice is to keep everything simple and then build up.

Anyway, I hope this makes sense and is in some way helpful.
GLaDOS
14
Years of Service
User Offline
Joined: 16th Jul 2009
Location: Italy
Posted: 20th Dec 2012 17:16
Thank you,29 games,but i think im not ready for this yet.Please take a look at this: http://forum.thegamecreators.com/?m=forum_view&t=202347&b=7

~GLaDOS
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 22nd Dec 2012 21:50
That's ok. I didn't realise that I had written quite as much but in the end I thought it would be easier to write a long response than to play a game of "forum ping pong" trying to figure out what you did and didn't know.

Login to post a reply

Server time is: 2024-04-26 07:23:20
Your offset time is: 2024-04-26 07:23:20