Is there source code available for Concrete Jungle? Or at least example projects that show how to do zoom and pan/scroll with just positioning and scaling?
I found some nice extensions (Viewport and Surface) and effects (Looki's lens and Sphax's CS_Zoom effects), but none of them port (I want Windows, Mac, iOS and Android support).
I've seen a number of posts here and on Steam that say basically "Concrete Jungle handles this nice and smoothly, for a recent example." But they never say where to get the source! And no one asks, as if everyone who sees those posts knows just where to go to see how Concrete Jungle did it... but I don't:(
Any help would be greatly appreciated. I can certainly work it out myself with math, position and scaling of everything, but seems a shame to recreate the wheel again on this.
Concrete Jungle and zooming/panning
A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.
Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!
Clickteam.
-
-
I highly doubt that commercial games that people created are giving away the source.
I also use zooming for IOS and Android, but i paid for it to have it done, since I couldn't figure it out properly.
If you search the forum, you will find some basic examples on how to do it. and then it's just a matter to get things right with the touch object.Good luck
-
Well then I don't get why people say "look at Concrete Jungle" as if that's an answer to how to do zoom and scroll. So I thought maybe someone had published the source or at least that part. And yes, some commercial games publish their source.
Anyway, I take it by that response and the silence that follows that there is no example code to be looked at for this, and the people who say to do so are just teasing us.
If anyone else knows otherwise, please reply. Thanks! -
I think you'll have to recreate the wheel
mostly because any project works on his own,
and each one has its own requirements/peculiarities,
it can be simple or not so much, depending on your needs.The basics would look like:
1) apply the same qualifier to all objects you want to zoom (this one just for making code sleeker..)
2) store all these objects positions in their alt. values (values X,Y are perfect for this mean)
3) use a single value to store the "zoom" ratio (a float number, 1.0 is starting size)
4) scale these objects accordingly when you zoom in/out (set scale to >> zoom_ratio)
5) set their X,Y positions to alt. val. X,Y * zoom_ratiopanning is just a matter of adding an offset to X,Y values of all zoomable objects
important notice: use floating point values for zoom_ratio and for X,Y values
this will get you up and running,
then you'd better also "move" your objects directly by their alt. values X,Y, so you'll need a custom movement for this
and you'll (probably) have to figure out how to properly center the content on screen,
and perhaps you'll need to think carefully when to scale (when player hits "zoom") and when to pan (when player drags),
as doing it "always" could slow down your project (depending on number of objects / graphics size..)
scrolling might complicate things still further as you might need to code additional offsets for that..
and you might have to overcome some "rounding" issue when scaling adjacent objects
and you'll need to think your starting graphics size to have the crisp result you need but without overloading the system
and you might need to code your own zooming UI with apt +/- coefficients and/or touch code like Perry said
etc. ect.you see there's much going on and very different situations so it's hard making a simple all-round framework for this
(if not only covering the basics, like first 5 steps above) -
who is this mystery person appeared out of nowhere with no products? perhaps you dont have access to what you may need
-
Well then I don't get why people say "look at Concrete Jungle" as if that's an answer to how to do zoom and scroll. So I thought maybe someone had published the source or at least that part. And yes, some commercial games publish their source.
Anyway, I take it by that response and the silence that follows that there is no example code to be looked at for this, and the people who say to do so are just teasing us.
If anyone else knows otherwise, please reply. Thanks!Where do you get "Why people say Look at Concrete Jungle" ? You are new to the forum, and I did a "Concrete Jungle" and you are the only one who asked about it.
Do a search for "zoom" and you get 3 pages full of it and there are even examples for IOS and for Windows look in the Examples folder.. there is one as well.And please register the product(s) so we all know about what platform you are talking about.
Concrete Jungle is for Windows / IOS / Android.. and they are all different for Zooming
-
I havent tried this myself, but i think the easiest way to do zoom like concrete jungle is to use Ultimate fullscreen object. With UFO you can scale things (2x, 3x etc) in the commands and I wouldnt be surprised if thats actually what CJ use since it's instant scaling instead of zooming in and out (from what i remember).
-
Wow, thanks for all the great responses! TLDR: I've written my own zoom+pan and it's working great!
Schrodinger, thanks for the detailed outline of how to do so. Fortunately I ended up doing pretty much what you said. And your additional considerations will be very helpful as I go along.who is this mystery person appeared out of nowhere with no products? perhaps you dont have access to what you may need
Very fair question! I'm about a year away from a first product, I estimate. So that's why you see nothing. It will be a computer version of a board wargame, which I'm developing in joint venture with the company that publishes the physical game. My aim is to have it run on Windows, OS X, iOS, and Android. To that end I'm ending up having to code many things myself, like zoom, so that it uses only core features and cross-platform extensions. So far, so good, just some extra work. Fortunately I have 40 years programming experience:)Where do you get "Why people say Look at Concrete Jungle" ? You are new to the forum, and I did a "Concrete Jungle" and you are the only one who asked about it.
Hmm, sorry, maybe that was only on the Steam forum. I saw at least two such posts; here's one: <Please login to see this link.>. I've been reading so many posts on both forums on so many topics, I lose track of where I saw what!Do a search for "zoom" and you get 3 pages full of it and there are even examples for IOS and for Windows look in the Examples folder.. there is one as well.
I have done, and all the ones I've seen use extensions that only work on some platforms. I'll go look through the Examples folder again, though. Thanks for the tip.And please register the product(s) so we all know about what platform you are talking about.
I'm figuring out how to register my Fusion products now. When I first read this I thought you meant register the product I'm working on:)I havent tried this myself, but i think the easiest way to do zoom like concrete jungle is to use Ultimate fullscreen object.
Sadly, Ultimate Fullscreen is only for Windows. Thanks for the suggestion, though.
You all are great! -
Hi there, I'm the dev!
Schrodinger is right- I made a custom zooming engine for the game. It was the only reliable solution I could find at the time. Basically there's a custom positioning system with it's x and y recorded in the objects alterable values. Then when an object or the camera is moved, the engine converts those values to Fusion's positioning, along with scale. It's pretty much exactly what Shrodinger outlined.
I was going to release the source code for it but I simply haven't had the time to seperate it from the rest of the code and clean it up yet. Since I've had a few messages about this I'll try and find the time to do so.
-
colej_uk, thank you so much! What you describe was what I ended up doing, and it does me a world of good to hear that I'm on track:)
Great game, by the way. -
I can't f**king believe this, there is no cross-platform zoom in/out object ... Actually I couldn't even find a way to zoom for Mac and Android ! Seriously, how hard it was for Clickteam to port the Viewport object to the remaining platforms ? I've found posts older than 2010 with this issue
[MENTION=18866]schrodinger[/MENTION] [MENTION=6156]colej_uk[/MENTION]
I've followed the steps, but I get seams/gaps at certain zoom levels. Can you tell me how to use floating point values ?Is there any way to do it with Window Control Object ?
-
there are a number of reasons that could cause seams, so it has to be tailored on your setup
you might try some of the following ideas:
(if applicable)1) put hotspot in bottom left corner of the object - and then push it one pixel below in Y
(this is because X scaling keeps hotspot reference at solid left border, while scaling will grow the hotspot position up a bit if you keep it "over" the graphics,
while putting it one pixel below solves the issue
never investigated much on why and when, but it always happened when I scaled 32x32 tiles)2) round your scaling factor so that it gives suitable integer multiples of your starting tiles size
3) set tiles positions at zoom factor, but increase zoom a bit for tiles scale so they take that one extra pixel - or gap size
(this migh look not so good though, depending on the application)To use floating point values in Fusion you just have to input it as a float in the expression editor (i.e. set myvalue = 1.23456)
or transorm your integer input through another float in the expression editor (i.e. *1.0 or +0.0)
(so it can't be done in edit time for values)Seen your other post on F3 thread - be assured, with full shader portability, this will be trivial across platforms in F3
-
1) It doesn't work for me, or I've implemented it wrong
2) Is a good idea, but I need fluent zoom so I need to use floats
3) Setting object's scale to zoomFactor + 0.01 seems to have done the trick This might also fix my Please login to see this link. .Also, can I use it with the Platform Movement object ? To set it's values based of zoomFactor ?
Probably I will end up using the Viewport object for Windows since it supports zoom and I can implement split-screen, and have the scale method for other platforms.
Can split-screen be done on any other platform except Windows (with Viewport object) ?
I've attached a little example that is working. Feel free to update it if needed.
-
Cool you had it working!
You could avoid foreachs btw:
Please login to see this attachment.(won't change much really... just shorten the code)
I think you could do split screen in other platforms,
with lot of work XD (like duplicating the whole game area..)
or *perhaps* with a little less work and sub-application object,
never tested if / "how much" it works on android tough
so can't say if this is really doable -
Holy, a Zoom in/out effect without need of extensions? I'm interested.
Though curiosity, why is it zooming from the top left corner? Any way to change the position where it zooms in, instead of top left corner?
I imagine everything has to be active object for this effect?
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!