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 / Help, Multiscreen CCTV (Cams or Images?)

Author
Message
Bardolf
15
Years of Service
User Offline
Joined: 15th Feb 2009
Location: UK
Posted: 14th Jan 2012 06:41
Hi Guys,
Looking for a bit of a push in the right direction for a game I'm starting, styled in the "2D-but-looks-3D" Point and click, like so many Web-based Flash games.

I plan to have multiple (16) background images that simulate a "live" CCTV environment with various extra items added into "camera views" from time to time.

On top of these backgrounds, "people" would be wandering about (from room to room) infront (and possibly behind) the other background imagery.

The problem is, I don't know whether to use Cameras or Images...



Q1 - Is it best (smoother/quicker) to permanently add the extras into the background images or utilise an "Added items" Array and output each one as required, for every main loop sync-cycle?

Q2 - With the Multiple rooms/views, is it best to create a Camera for each view when viewed "live" overall within a 4x4 grid of Cams/images or just update each image and place a shrunken copy of it on the screen? (Are Cameras actually needed?)

Q3 - Would I be better off making ONE large Image containing ALL Room images and creating 16 Cameras to view the action (in other words, design a whole virtual, but still 2D, building and its CCTV System) or keep it as I originally thought of, as technically 16 totally seperate entities and rely on handcoding their transitions (ie when moving from Room 3 to Room 4)?


I'm stumped as to which way would be the better choice and what consequences it would produce.

I have even toyed with the idea of doing the whole thing in 3D but as this would be my first major DBP project (over 20yrs exp in "Linear" Basic Programming) I'm a bit apprehensive about doing that yet a while.

Many thanks...
Any feedback, desperately more than welcome.

If at first you don't succeed - Hide the evidence
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 15th Jan 2012 11:33 Edited at: 15th Jan 2012 11:34
A1 - It would be quicker to add the extras into the background image, but less dynamic.

A2 - If you're working with 2D, you don't need cameras.

A3 - I find it hard to wrap my mind around what you're trying to do... So you have only 2D images, and you want to set up cameras from multiple angles? That's physically impossible, because cameras rely on having a 3D environment to be able to view things "from different angles".

If you did have a 3D environment, you'd only ever need one camera because that's all you'll ever show on the computer screen... If you wanted to change perspective, you'd simply change the position and rotation of the camera and BOOM you'd have a new perspective.

TheComet

Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 15th Jan 2012 11:39 Edited at: 15th Jan 2012 11:42
Quote: "The problem is, I don't know whether to use Cameras or Images..."

If this is purely 2D (even though it looks 3D) then I don't think cameras are going to be of much use so I'd stick to using sprites and images.

Quote: " Is it best (smoother/quicker) to permanently add the extras into the background images or utilise an "Added items" Array and output each one as required, for every main loop sync-cycle?
"

Technically, the latter would be smoother however, depending on how many images you plan on including (and the hardware you're running your game on) it may not make a difference. But practice wise, the latter would be best.

Quote: "With the Multiple rooms/views, is it best to create a Camera for each view when viewed "live" overall within a 4x4 grid of Cams/images or just update each image and place a shrunken copy of it on the screen? (Are Cameras actually needed?)"

It's hard for me to picture exactly what you want (any examples you can link to?) so, for now, I think you should have a play around with the cameras as well as images in DBP and you might come to a conclusion yourself. But typically, cameras are used for 3D stuff.

Quote: "I'm stumped as to which way would be the better choice and what consequences it would produce."

Well, it might be worth while playing around with DBP's camera system and sprite system and then select which one you think is most suited for the job.

...aaand the TheComet beats me to it.

Bulsatar
13
Years of Service
User Offline
Joined: 19th Apr 2011
Location:
Posted: 16th Jan 2012 16:12
If you are going 2d then I would suggest creating arrays for each "cctv" that you are going to display and layer your sprites according to the order in the array. I am pretty sure (means I am taking a guess) that by default dbpro writes to the screen in order so if you want something in front of something, have that printed to screen after. This way you can appear to layer your environments with only 2d sprites. To make sure things are speedy, alter your positions and do all of the collision checks and everything else first (all the math stuff) and then at the very end of your code print the new sprite locations to the screen.

Hope that helps!!
Bardolf
15
Years of Service
User Offline
Joined: 15th Feb 2009
Location: UK
Posted: 16th Jan 2012 16:15
Many thanks for the info guys (Comet, Hodgey) ...

I can understand why you're confused on what I'm trying to do (I would be too LOL) and appreciate your feedback.

Unfortunately, I have no exact examples I could link to for better examples other that possibly the Generic "Facebook" Apps of "Cafe World", "Sims Social" etc. which (thinking about it) are essentially 2D.

My (original?) idea is loosly based on the running of an Airport and the different events, both Inbound and Outbound.
Probably the best way to explain would be to think of the Player as sat behind the virtual "CCTV Monitor" with overall views of the various areas from which he/she picks the events to zoom to.

I was hoping on having these 16 Thumbnails(?) as all running at the same time (as would be a real CCTV), so that Customer 'n' can be seen walking from the Foyer, through the Check-In area and onto the Departures Lounge etc (hence thinking I needed Cameras).

I'm probably confusing myself with thinking "3D-looking" graphics as it would essentially be 2D, wouldn't it? So Cameras would only make it more complex, with working in Z-axis too.

Again, many thanks for the info.


Regards...

If at first you don't succeed - Hide the evidence
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 16th Jan 2012 18:48 Edited at: 16th Jan 2012 18:50
Ah, so you want a grid of 16 "thumbnails" showing different perspectives of the 2D scene all at once? This is going to be a bit tricky because you're going to have to define 16 viewports and draw to them all separately. I suggest using a User Defined Type in conjunction with an array to approach this. Off the top of my head (untested), but it should point you in the correct direction:



CreateViewport() will create a viewport with the index index at the position x,y.
DestroyViewport() will destroy the viewport with the index index
AddImageToViewport() will add an existing image to the viewport to be drawn with the offset x , y.
RemoveImageFromViewport() will remove an image from a viewport
ControlViewport() will draw all active viewports.

Note that the images you add to each viewport should be smaller than the viewports size (so if your screen is 1024x768 and you have 16 viewports, the maximum width of a viewport can be 1024/4 = 256. Images you add can't be larger, or it will overlap with other viewports)

TheComet

Bulsatar
13
Years of Service
User Offline
Joined: 19th Apr 2011
Location:
Posted: 17th Jan 2012 02:06
@TheComet...
Just want to make sure I understand your code as I was reading through this post. When you create the viewport image, you are setting all of the items of the viewport in sequence (no matter the size) then grabbing the image at the size of the view port and pasting that to the screen...yes? This would mean that as you move different images across the viewport you don't have to worry about the actual position of the object until it is completely out of the viewport area because any "over lap" of the added/moved images under the viewport will be cut when grabbing the completed image...yes?

Sorry to jump in, just making sure I understand your logic
Bardolf
15
Years of Service
User Offline
Joined: 15th Feb 2009
Location: UK
Posted: 17th Jan 2012 18:32
Quote: "ControlViewport() will draw all active viewports."

I assume you meant to put 'DrawViewport()', as it is in your code

@Bulsatar: No problem with jumping in... it saves me working too hard on understanding Comet's Coding Many thanks for your tip on 2D layering too (I missed it last post).

@Comet: Yeah similar to that (nice coding too, never thought of embedding 'TYPES') but unless I'm mistaken it looks like its setting up a series of screens each with 16 "CCTV" images on?
I'm not that ambitious... yet Just looking for the one screen of 16 images but that's just a small change with the code.
(Although the thought of having a potential of 100's of CCTV's to "choose" from does sound a nice alternative...

Many thanks guys, I think that'll keep my little brain cell from being lonely for a few days

If at first you don't succeed - Hide the evidence
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 17th Jan 2012 19:18
@ Bulsatar

I wrote that code in a rush, lol.

It should handle 16 viewports, each containing a maximum of 16 images. The images of each viewport are draw directly to the screen, so the feature of it being clipped isn't there; It would just stray off out of bounds of the viewport. That's a good idea of yours of drawing the images off-screen and then grabbing a final image of it for the viewport.

Again, it's just a basic guideline I tried to post, nothing that's fully functional yet.

@ Bardolf

The whole time I thought you were trying to make 16 different viewports like this:



And then be able to assign images to every viewport... Oh well, glad I was of some use

TheComet

Bardolf
15
Years of Service
User Offline
Joined: 15th Feb 2009
Location: UK
Posted: 18th Jan 2012 00:14
@Comet:
No just the one like you've got in the image (the "Panasonic" screen) then the 16 views ("ATM", "STATION" etc) would be slightly more wide-angled to see Whole Rooms - Each one Clickable to give a Fullscreen Zoomed View.
Maybe Version 2.0 can have more Camera Monitors

If at first you don't succeed - Hide the evidence
Bulsatar
13
Years of Service
User Offline
Joined: 19th Apr 2011
Location:
Posted: 18th Jan 2012 14:45
The only thing about doing this 2d instead of 3d is that you will have to get the perspective correct on your sprites for each view of the monitor. It might be easier to do this in 3d or setup the models in a 3d package and take snap shots of the scene as you want it to play out on the screens...
Bardolf
15
Years of Service
User Offline
Joined: 15th Feb 2009
Location: UK
Posted: 18th Jan 2012 23:26
That's all part of the problem I was having, Bulsatar...

I thought at least with 2D I could either Gimp (or even MS Paint LOL) a few quick backgrounds together, but then it would be at the sacrifice of the Awesomeness of 3D. Plus, as you say, getting sizings correct too.

In 3D, it would be easier (I think) for Collision detection and have a better realism feel (CCTVs with Pan & Zoom for instance) I doubt if I could create a realistic enough World Model (a Virtual LAX, Heathrow etc) in 3D this side of 2112 ... never mind 2012

I'm assuming that for the Monitor, It'd be just a case of:

for n = 0 to 15

next n

If at first you don't succeed - Hide the evidence
Bardolf
15
Years of Service
User Offline
Joined: 15th Feb 2009
Location: UK
Posted: 18th Jan 2012 23:51
That's what I thought to be honest Bulsatar...

It's a choice of easier using "doodled" 2D backgrounds and images with probably a more Cartoon feel, or a longer development time but more realistic 3D environment (ie CCTVs with Pan/Zoom).

Although using an external package for Sceneshots sounds good, it wouldn't work in this case as I'm hoping to have (at least) dozens of "Travellers" to the areas at a time, all Waypointed using AI and Pathing or usign Click/Drag control from the Player.
At any one time there could be people wanting the nearest ATM, looking to Check-In for their LAX Flight, in need of a Trolley etc etc..

All in all, its probably a daunting task to do to the standard of how I'd like it (always been a Perfectionist when it comes to Program Code ).

Looks like I'll be using this as one heck of a steep learning curve to migrate from "Basic" and VB6 to DBPro

If at first you don't succeed - Hide the evidence
Bardolf
15
Years of Service
User Offline
Joined: 15th Feb 2009
Location: UK
Posted: 19th Jan 2012 14:47
Oops, sorry for Double (now triple) Posts guys... Browser Froze during my First Posting and because I'm on "Noob Approval" ended up posting both

Now it looks like my total knowledge is just based on an empty For...Next loop

If at first you don't succeed - Hide the evidence
Bulsatar
13
Years of Service
User Offline
Joined: 19th Apr 2011
Location:
Posted: 19th Jan 2012 18:01
Why don't you build something really quick in FPS creator and export to be used in dbpro (there is a tutorial around here somewhere that shows you how...). That will allow you to quickly setup a 3d environment and then you can place your cameras around the environment and grab images of the environment and paste them to the cctv screen (there is another tutorial that shows how to grab a shot from a camera somewhere also...). You can set the coordinates of the 3d environment off screen somewhere and just use the images you snag from the cameras to post to the cctv screens.
Would probably be the fastest way to test your idea out
Bardolf
15
Years of Service
User Offline
Joined: 15th Feb 2009
Location: UK
Posted: 19th Jan 2012 18:46
FPS Creator!! *hits forehead*

I keep forgetting about that one!
Installed all from the Studio CD when first purchased it, but since having Windows ReInstalled I only done DBP.

I'll have a trawl for those Tutorials later on.
Many thanks Bulsatar.

If at first you don't succeed - Hide the evidence

Login to post a reply

Server time is: 2024-11-22 06:26:14
Your offset time is: 2024-11-22 06:26:14