Graphics

P1SIM is a commercial game under development featuring traffic, logistics, city building and more.
User avatar
smallfly
Chairman
Chairman
Posts: 884
Joined: 19 Oct 2009 13:29
Location: Germany

Graphics

Post by smallfly »

I start this thread to discuss all general graphics aspects of P1SIM with you.
thphwh wrote:OT: I like the graphics a lot, it reminds me of Simutrans Comic Pak. How are you making them?
All graphics are drawn pixel by pixel using GIMP. Thus I can use multiple layers and its very easy to duplicate game objects like cars and citizens. The multi layer system is also very helpful for restructuring buildings, roads etc. below the already placed moveable objects.
gimp.png
gimp.png (25.98 KiB) Viewed 20792 times
www.p1sim.org - P1SIM - Traffic, Logistics, City-Building & more
Join the discussions here on tt-forums.net!
User avatar
SkeedR
Tycoon
Tycoon
Posts: 2264
Joined: 11 Jul 2004 14:55
Location: West Midlands
Contact:

Re: Graphics

Post by SkeedR »

I just want to say that I'm freaking loving the graphics.
Last known as: Weirdy
User avatar
robo
Route Supervisor
Route Supervisor
Posts: 398
Joined: 14 Jan 2007 12:14

Re: Graphics

Post by robo »

So far I like your graphic style. Older 2D-games are often very dark, but your choice of colours look good. I'm still playing on an old machine (P4), because I'm not interested in all these modern action/fantasy games with fancy graphics.
But two points are critical. The vehicle animations should look good, which may be difficult with larger vehicles and if you play with trains, you always want to zoom out and still want to see clean graphics. If you look for example at locomotion, graphics exspecially ground textures look ugly if you zoom out.
User avatar
thphwh
Director
Director
Posts: 516
Joined: 23 Dec 2011 13:50
Location: Letchworth GC

Re: Graphics

Post by thphwh »

I'd like to see company colours implemented; other than that the graphics are very nice to look at. If addons are supported, it shall be easy to draw graphics. :grin:
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: Graphics

Post by Pyoro »

Maybe not quite "graphics" technically, but will there be something similar to OpenTTD's NewObjects? Eye-candy basically?
User avatar
smallfly
Chairman
Chairman
Posts: 884
Joined: 19 Oct 2009 13:29
Location: Germany

Re: Graphics

Post by smallfly »

robo wrote:want to zoom out and still want to see clean graphics
Fair point. I will see what I can do.
thphwh wrote:I'd like to see company colours implemented
To be honest, I planned NOT to realize company colors, since there can be more companies on a map than easily distinguishable colors. But at the moment I'm also a fan of company colors. Even though there could be several companies with nearly the same color.

Company colors are associated with one performance problem. Since all sprites are drawn to 3D objects first, I cannot use the company color technique of OTTD (real time altering of multiple pink pixels to the final company color). Instead I have to split all vehicle sprites into two sprites. One for the (always same looking) frame, windows, tires etc. and one mono-colored sprite which will be replaced by the final company color through OpenGL algorithms. This means that there could be double the number of vehicles in P1SIM, when I wouldn't implement company colors. But again: Currently Im planning to realize this feature.
Pyoro wrote:Maybe not quite "graphics" technically, but will there be something similar to OpenTTD's NewObjects? Eye-candy basically?
thphwh wrote:If addons are supported, it shall be easy to draw graphics. :grin:
I opened a new thread "Modding" for discussing these issues.
www.p1sim.org - P1SIM - Traffic, Logistics, City-Building & more
Join the discussions here on tt-forums.net!
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: Graphics

Post by Lakie »

If those sprites go through a OpenGL shader (whilst being drawn to '3D' objects), it might be possible to either take two sprites (one being a recolour mask) as input, or just recolour a specific colour range for those objects. Depending on your implementation, of course.
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
User avatar
smallfly
Chairman
Chairman
Posts: 884
Joined: 19 Oct 2009 13:29
Location: Germany

Re: Graphics

Post by smallfly »

Lakie wrote:If those sprites go through a OpenGL shader (whilst being drawn to '3D' objects), it might be possible to either take two sprites (one being a recolour mask) as input, or just recolour a specific colour range for those objects. Depending on your implementation, of course.
I didnt touch shaders yet (for complexity reasons). Perhaps I will use them in future and then be able to recolor a specific color range of a sprite. At the moment, I can only blit sprites and recolor the complete sprite with a single overlay color (with variable intensity).
www.p1sim.org - P1SIM - Traffic, Logistics, City-Building & more
Join the discussions here on tt-forums.net!
User avatar
smallfly
Chairman
Chairman
Posts: 884
Joined: 19 Oct 2009 13:29
Location: Germany

Re: Graphics

Post by smallfly »

robo wrote:you always want to zoom out and still want to see clean graphics. If you look for example at locomotion, graphics exspecially ground textures look ugly if you zoom out.
Hey robo! Just for you an option for high quality zooming ;)

http://www.p1sim.org/?p=623
www.p1sim.org - P1SIM - Traffic, Logistics, City-Building & more
Join the discussions here on tt-forums.net!
User avatar
robo
Route Supervisor
Route Supervisor
Posts: 398
Joined: 14 Jan 2007 12:14

Re: Graphics

Post by robo »

I like it. A clean zoom in 2D is probably not very easy, because most old 2Dgames I know avoid it. One game which had a good zoom and ground textures which comes to my mind is Industry giant 2, apart from the deepest zoom. There's an unpack tool/nvidiamod available where you could analyse how the ground textures work, probably similar to what Lakie described, it's a mix of at least two larger sprites going over several tiles.
It may be enough to have two zoom levels, depending how large the maps turn out. What I like in general is that railroads and street roads have the same size (one tile for one direction), because trucks/roads look to small compared to trains in locomotion (this may be one reason nobody uses them in the game ;-) )
In generell it may be better to go for less intensiv colours and a less grainy look like for example age of empires online (only judging from the screenshots), but a feature I liked in the more creative game Rollercoastertycoon 2 is that you can change the ground textures in the game.
lukasz1985
Route Supervisor
Route Supervisor
Posts: 429
Joined: 27 Mar 2013 08:58
Location: Strumien
Contact:

Re: Graphics

Post by lukasz1985 »

If you are not using shaders then you lose a whole world of possibilities. With shaders you could even emulate lighting with your graphics.
Really think about it. It's not much of a deal - you will spend maximally week refactoring your code.
TinyMusic
Tycoon
Tycoon
Posts: 1422
Joined: 02 Feb 2013 02:03

Re: Graphics

Post by TinyMusic »

2D means that there is only a view from the top, right?
Formerly known as UseYourIllusion.
Java Scenario Found Here - Version 2 out
[tweɪ̂ pû tɕʰì wɔ̀ mǐlɤ lû tɕʰìŋ nì pɑ́ŋmɑ̌ŋ]
User avatar
robo
Route Supervisor
Route Supervisor
Posts: 398
Joined: 14 Jan 2007 12:14

Re: Graphics

Post by robo »

Another interesting question is how you want to deal with landscape in a topdown game (you once said that you want to go first for topdown and later for isometric view).
One idea I liked and found on the web with a simple approach and similar to games like for example caesar3 which could work for both views is this: http://www.bunpow.com/stock-graphic/123 ... 30837.html
User avatar
smallfly
Chairman
Chairman
Posts: 884
Joined: 19 Oct 2009 13:29
Location: Germany

Re: Graphics

Post by smallfly »

robo wrote:It may be enough to have two zoom levels, depending how large the maps turn out.
The map size is nearly unlimited. You can scroll nearly forever in any direction. (Terrain size: Integer.MAX_VALUE tiles x Integer.MAX_VALUE tiles) Thus I implemented three zoom levels. Here is a preview of the maximum zoom-out level:
three_zoom_levels.png
three_zoom_levels.png (91.99 KiB) Viewed 19091 times
lukasz1985 wrote:If you are not using shaders then you lose a whole world of possibilities. With shaders you could even emulate lighting with your graphics.
Really think about it. It's not much of a deal - you will spend maximally week refactoring your code.
Shaders are fantastic. And perhaps I will implement them later. But keep in mind that there are hundred (if not thousands) of light sources on the screen.
lights.png
lights.png (43.66 KiB) Viewed 19091 times
Currently I use an offscreen light map where all light sprites are drawn to. This light map is applied to the drawn terrain + vehicles layer. It took several weeks to implement that feature. At the moment I don't see, why I should use the rare development time for implementing shaders for light effects, when are still no trains, planes, ships, buildings on the screen. But again. I know about the existence of shaders. And I will have them in mind during the further development process.
TinyMusic wrote:2D means that there is only a view from the top, right?
In this context, yes. P1SIM has a top down view.
robo wrote:Another interesting question is how you want to deal with landscape in a topdown game (you once said that you want to go first for topdown and later for isometric view).
The landscape is already finished. Just have a look at the following screenshot. And if P1SIM gets an isometric view in the future, its not very hard to use the very same landscape.
terrain.png
terrain.png (159.31 KiB) Viewed 19091 times
www.p1sim.org - P1SIM - Traffic, Logistics, City-Building & more
Join the discussions here on tt-forums.net!
lukasz1985
Route Supervisor
Route Supervisor
Posts: 429
Joined: 27 Mar 2013 08:58
Location: Strumien
Contact:

Re: Graphics

Post by lukasz1985 »

About the lighting: you don't have to take every light in the scene into account. What I actually meant is that you could put a directional light for a sun somewhere and give every object a normal map that would display objects as if they were sun-aware. What I mean is called "Cel shading" i guess : http://www.youtube.com/watch?v=4rUbSh04 ... e=youtu.be. That's a very neat trick - if of course it fit's the style you want to achieve.

And about the performance: I would like to ask you if you use immediate mode for rendering? I mean, I dont know if you use Slick or LibGDX or just LWJGL but if you are using glBegin() and glEnd() calls to draw things on the screen then it's very not effective. You could use vertex arrays to store data on the GPU or VBO's - the increase in performance is dramatic.
User avatar
smallfly
Chairman
Chairman
Posts: 884
Joined: 19 Oct 2009 13:29
Location: Germany

Re: Graphics

Post by smallfly »

lukasz1985 wrote:And about the performance: I would like to ask you if you use immediate mode for rendering? I mean, I dont know if you use Slick or LibGDX or just LWJGL but if you are using glBegin() and glEnd() calls to draw things on the screen then it's very not effective. You could use vertex arrays to store data on the GPU or VBO's - the increase in performance is dramatic.
I am using Slick2D. I tried Renderer.setRenderer(Renderer.VERTEX_ARRAY_RENDERER) as well as the IMMEDIATE mode. No effect. Both runs at 960 frames per second on my machine. I will keep your hint in mind, if I get any performance problems in future.
www.p1sim.org - P1SIM - Traffic, Logistics, City-Building & more
Join the discussions here on tt-forums.net!
LocoMH
Chairman
Chairman
Posts: 845
Joined: 26 Nov 2005 16:21
Location: Dresden (formerly Ruhr Area)
Contact:

Re: Graphics

Post by LocoMH »

So, I have a few questions that came to my mind:

1. If the highest zoom level (the farthest out) covers an area of roughly 80*60 (I could be quite off on this value *Edit) squares and a runway has a length of 3.000m at 5m/square -> 600 squares length of a runway, so we see just about more than 10% on the highest zoom level - it seems a bit tough to keep track of your airport that way.

2. Integer.MAX_VALUE = 2 million something in java, right? That means, we have a side length of the map of more than 10 million meters - or 10.000 km, thus an area of more than 100 billion km² (100 Milliarden auf deutsch)? That's insane. Crazy - great! But there's only this one map, right?

3. If there is only this one large map, how are we gonna find back to our "home town", after scrolling in some direction? And how is the user going to get an overview of the whole map? To know, where he wants to plan his new railway tracks or airport? I'm guessing the distance between two airports will be kind of the same as in reality.

Edit:
I would think it's 128 squares in width that are shown? So 640m. That's much better, still - for a long runway, barely a fifth.
User avatar
smallfly
Chairman
Chairman
Posts: 884
Joined: 19 Oct 2009 13:29
Location: Germany

Re: Graphics

Post by smallfly »

LocoMH wrote:1. If the highest zoom level (the farthest out) covers an area of roughly 80*60 (I could be quite off on this value *Edit) squares and a runway has a length of 3.000m at 5m/square -> 600 squares length of a runway, so we see just about more than 10% on the highest zoom level - it seems a bit tough to keep track of your airport that way.
On my screen resolution 1680x1050, playing P1SIM in fullscreen mode, max zoom ("far"), there are 210 horizontal tiles visible. And the runways wont be 3.000m long in P1SIM. Probably 1.500m or less. Thus you will be able to see more than half of the runway or even the complete one. Depending on your screen resolution and the final decision about runway length.
fullscreen_zoom_far.png
(469.47 KiB) Downloaded 4 times
LocoMH wrote:2. Integer.MAX_VALUE = 2 million something in java, right? That means, we have a side length of the map of more than 10 million meters - or 10.000 km, thus an area of more than 100 billion km² (100 Milliarden auf deutsch)? That's insane. Crazy - great! But there's only this one map, right?
Max integer value is 2.147.483.647 Thus the randomly generated map (you get a new map when starting a new game; except you decide to manually set the map seed) has a size of 4.611.686.014.132.420.609 tiles.
LocoMH wrote:3. If there is only this one large map, how are we gonna find back to our "home town", after scrolling in some direction?
Select a train, a city or any object in one the many overview lists and the map view will jump to that object.
LocoMH wrote:And how is the user going to get an overview of the whole map? To know, where he wants to plan his new railway tracks or airport? I'm guessing the distance between two airports will be kind of the same as in reality.
There is a minimap. And Im planning to implement a zoomable minimap, so that you can even zoom out the minimap.
minimap.png
(379.23 KiB) Downloaded 4 times
Attachments
minimap_16x_zoom.png
(526.82 KiB) Downloaded 4 times
www.p1sim.org - P1SIM - Traffic, Logistics, City-Building & more
Join the discussions here on tt-forums.net!
rsdworker
Traffic Manager
Traffic Manager
Posts: 148
Joined: 18 Mar 2009 13:58

Re: Graphics

Post by rsdworker »

wow that's good questions i love it the mini map - i will look forward to be in Alpha
User avatar
glenjimen
Traffic Manager
Traffic Manager
Posts: 137
Joined: 16 Aug 2013 00:44

Re: Graphics

Post by glenjimen »

smallfly wrote:There is a minimap. And Im planning to implement a zoomable minimap, so that you can even zoom out the minimap.
If in the full game screen, you can zoom in and out, and in the mini-map you can zoom in and out, why have a mini-map at all? I looks like being able to zoom out further would solve the problem.

In Trainz 2012 (a 3-D simulator) when you zoom out super far, the screen fades into the map. I don't know if this is possible in a 2-D game, but it would be cool if, after zooming out past zoom level "far", the screen automatically became the mini-map.
Visit the Directory --> Loco-Dat-Directory
Locked

Return to “P1SIM”

Who is online

Users browsing this forum: No registered users and 5 guests