Not logged in, Join Here! or Log In Below:  
News Articles Search    

Submitted by Dan González Rodríguez, posted on April 25, 2001

Image Description, by Dan González Rodríguez

I know that this IOTD won't be interesting for almost all of flipcoders. And I will be pleased if more than ten posts will be returned. But I really want an image from my work to be shown, despite its low quality.

The image is a composition of my current work, CKCEd, a terrain editor for a train simulator (A boring final work at University). I just finished the texture generation for an elevation map, and here it is.

The image is composed by a top image and other four small captures itself. The top image shows a default view of the program working. Nothing evident here caused by the superposition of windows. With a texture definition window you can specify sixteen textures each one for a specific height/slope criteria. The height and slope ranges can be defined by trackbars. With a light definition window you define the three light components: ambient, incident and projected. The angle of incidence is defined by a click&move segment.

The four bottom images are the colored heightmap, the lightmap, the texturemap, and the modulation between the last two, for a case where the heightmap is 512x512, procedurally generated by a plasma algorithm (don't blame me for this), and slightly edited with my program. If someone recognizes the textures, don't worry about it, they were stolen from everywhere. Their combination is ugly and the result too. But it's my own mistake as a texturer guy.

The blending was done with a parametrized version of the sigmoid function: 1/(1+exp(A*(X-X0))). I think that the behaviour of this funtion makes it perfectly suitable for blending.

My program takes about five seconds in generate and show the final texture. Since my system is a PII440 and the test was done with a CBuilder++ 1 compilation in full debug mode, it doesn't seems to be very slow.

Planned features are railway edition (a simple set of segments, curved with a parametrized Hermite Interpolation), terrain modification to place the railway, entities management (buildings, trees, and so). Behind this project is the simulator that takes all the data created by the editor to build its levels. It's too soon to talk about the simulator, I think. The work is in a very early stage.

I don't find nothing more to say about that. I will be very pleased to read any comments and answer any question (assuming that there will be some comment or some question).

Saludos a todos.

Image of the Day Gallery


Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.

April 25, 2001, 12:30 PM

I love the look, and as i am workin gwith something similar, then i sorta like it more too :)
Any source?


April 25, 2001, 12:31 PM

It might be nice to put in a sinusoidal filter for your perlin noise function too, as you wont see the edges of the linterp then...


April 25, 2001, 12:43 PM

This man is my friend, so I should say something good about his job. But I am doing that every day (he ask me constantly for praises) and the result is that now I don't have anything more to say!.

Hey Dan, I was kidding, you know that I really love your work and I will always have something beauty to say. Maybe the word "gorgeous" will satisfy you.


April 25, 2001, 12:47 PM

that`s very interesting, i`m doing something similar at the moment.
is there a demo (or even source) for download? i would really like to see CKCEd in action.


April 25, 2001, 01:05 PM


have i looked on the internet for a good, free (maybe open source), terrain editor for game developement. This little app looks very promissing to me, please, could you tell us if there will a source/binaries release?

Nice job concerning the texuring, how do you actually store your terrain files?



April 25, 2001, 01:06 PM

I think tour IOTD looked excellent, interesting and fun to make. Don't be so shy :)


Ohad Eder Pressman

April 25, 2001, 01:09 PM

It looks very nice, and is most likely interesting for many people since there is a large amount of people/groups working on terrain engines that have came up with their own solution (which is most likely not a full-fledged terrain-texture editor like our friend here did).

Anyhows, it would be great to have a download somewhere.


April 25, 2001, 01:16 PM

I'm afraid 2 said something too clever, cuz there are many people who will NOT understand it. I hope they all are sleeping now.

That's very interesting, I'm doing something similar at the moment. Is there a demo to download ?

It looks very nice. Blue color, however, seems a little strange. But I assume that there is heightmap so I think we can forgive it.
Is this done in mfc ?

'If someone recognizes the textures, don't worry about it, they were stolen from everywhere' so do I, and I will not be worried. I dunno about others.
I saved your exp function in file called 'New Text Document.txt' for future use. If you eagerly want credits I can mention it in source file:0)

BTW: you know, you do almost same stuff like me :) I have similar ideas. Nice work !

Timothy Barnes

April 25, 2001, 01:24 PM

Nice textures


April 25, 2001, 01:26 PM

I like it. Good work.


April 25, 2001, 01:30 PM

I think you were selling yourself short in the caption. Nice work :)

The textures don't go together that badly, so I don't think you can complain too much :)


April 25, 2001, 01:44 PM

Actually I see nothing ugly in the combinations of those textures. And the lighting look very good (but I do have a soft spot for lighting)

Even though you say it's early, will there be a demo (as in !scene demo...) of your train simulator? and is it a train simulator like railroad tycoon or like ms train sim?

All in all it looks pretty... pretty pretty pretty.

Morten Bendix


April 25, 2001, 01:48 PM

Pretty work!.
No seas tan modesto Dan!.
No sé si te dejarán publicar el código del proyecto, pero por lo menos déjanos el ejecutable para trastear...
Don´t be so shy Dan!
I don´t think you´´ be allowed to publish your project´s source, but at least give us the executable so we can have a look to it...

The Wolf

April 25, 2001, 01:50 PM

Very good work, looks very good, can't wait to see the final version.
are the blending equation hardcoded? if so you might wanna make it
script based and then you'll be able to changed it on the fly and see the
changes without having to recompile.. just a thought...


April 25, 2001, 01:57 PM

That GUI of yours is looking good as well...
A little too good for a personal tool.
So are going to release it?


April 25, 2001, 02:38 PM

You shouldn't be so hard on yourself! That looks very interesting, and the graphics look just as high-quality as many commercial games. And you said it was a tool for a game? We expect those to be a little messy. Actually, I think you went through much more effort to make it nice then I would have. Most of my game tools are command-line utilities. Nice job.


April 25, 2001, 04:10 PM

First of all I must thank you all for your positive comments about my work. It's nice to have such a reception on my first IOTD.

Just now I'm uploading a CKCEd binary to my web place. So you can download it acessing to: (1.35 MB aprox.)

I must to make clear certain points about this binary. As you should suppouse this is a rough on-work version. So there are errors wherever you can't expect. Don't worry about these 'division by zero' and 'memory access violation'. I know of their existence.

The graphical performance is sluggish. Using GDI is not so nice as Microsoft assures. In this aspect I have had amounts of problems. So any idea will be welcome.

Some features are implemented but disabled due to a recent re-design of the program. The most important disabled options are those relative to load and save the maps. I'm currently working on this.

The .zip package includes some of the textures I'm using at that moment. You can only load TARGA images and the program considers it a 128x128 image whatever the resolution that the loaded image has.

As you can see the binary sucks, so it's predictable that those positive comments turns in more agressive ones when the program begins to be tested. :¬)

Let's continue killing my program. It runs fairly stable on W2K. In W98 it's not sure to work but it must work (please, please). There are some artifacts with fonts. I work with 96ppi system fonts and all suits perfect to its place. But with big fonts all appear cut. If someone knows how to overtake these issues in CBuilder++, please let me know.

The behaviour of some dialogs is not completed so take account of it.

Well, thats a light overview of how bad my program works. Every error diagnosis, comment, sugestions and so will be welcome. Since it's an University project I will not waste too much time on enhancing the program. But when I finally get my title you must be sure I will take it again to do something better. So every sugestion will be added to a 'wish list' and it will be studed in a near future. And, YES, You will appear on the credits :)

I will try to uploading to my website new versions periodically, so, if you are really interested on it, make a visit from time to time.

I must thank my friend, Barce, for wasting his third post to this site on me.

Raspberry: No source will be available. Explanation in the next lines.

1c4i4: Just now I'm working on file storaging. There will be two ways of saving. One goes for development maps and the other one goes for game maps. For the development map the elevation map is stored as it is, compressed with zlib. For tha game maps only the elevation data of the selected tiles are stored, also compressed with zlib.

geekster: The target is to make something graphically similar to Train Simulator. Of course I don't intend to do alone such as work. But I think I can do some nice stuff. There is nothing viewable yet. Be sure that when I've got something working there will be other IOTD from me.

Grugnorr: (Está bien esto de tener el comentario de un español). Yes you're right about the source code. The project copyright belongs to the University. This sucks but there is no other way. Despite of this, when the project was finished, I can do a better program with the things learnt. Something that looks like but BEAT my current work. You will have news of it. Sure.

The Wolf: I've do nothing on scripting. It's a good thought now included in my 'wish list'.

Now waiting for comments or e-mails (to avoid make this IOTD a discussion about my ugly skills as programmer :) ).
Sorry about my English. I'm enhancing it as well.



April 25, 2001, 09:28 PM

Looks good, although I haven't tried it fully because I had no .tga textures and I was too lazy to create some :)

Nice work

Hiro Protagonist

April 26, 2001, 01:14 AM

Very nice. Your university retains rights to your source code for projects??! I have never heard of that. My University didn't so anything like that. Strange.
Anyway, I'm off to d/l the executable. Let's hope I don't get any of those div by 0 errors.

Jan Niestadt

April 26, 2001, 04:06 AM

I thought the whole point of Universities was to publish their research and share their knowledge. It would be very sad if Universities start behaving like companies. Next thing you know they'll file for some trivial software patent.

Frans Bouma

April 26, 2001, 04:20 AM

Don't kill yourself off because YOU think your implementation is not up to par. WHen looking at the screenshot (the IOTD) I can only say: nice idea of a program! Perhaps the implementation is a little shakey at the moment, who carez: with more time on your hands you get a better result. The idea of creating textures like this is very ok and workable for a lot of situations.

Everyone who has been in University, doing their end work, knows that these assignments are pretty boring mostly and the less sucking parts are also the less important ones, unfortunately.

Keep up the good work.


April 26, 2001, 05:33 AM

If i recall correctly copyrights belong to university and the project writer, at least in UPC's FIB (Politechnic University Catalunya, and Facultat d'Informatica de Barcelona).
OTOH your project will go to your university library and "anybody" can read it there.
I think that a good solution will be that university publishes the final project on the web (but that would mean we'd have to write our projects in english :S)
Well, as my brother says:
"Nos vemos con los ojos" (see ya with the eyes)

Jon Coomber

April 26, 2001, 05:36 AM

My university (Plymouth UK) had a form to fill out in the final year indicating that anything included in the final project was their copyright. I got around this by not including any source code apart from an example asm code program that demonstrated something not really related to my final program. As my actual handed in project only included the binary, and the design, the code was mine. As the source was never included in the project report or associated material, it wasn't deemed to be part of it.

You may not be able to take this tack, but if you can, you can always offer to show them the source code if they have any queries about it, but still not hand it in as part of the project.


April 26, 2001, 06:14 AM

I see that you do 'Quadratic Antialiasing'
What 3x3 matrix do you use for this?
Could you explain your method perhaps?
I invented my own ages ago, and also did bicubic interpolation.

Alex J. Champandard

April 26, 2001, 07:50 AM

Usually, any ideas you come up with during a project while at University belongs to you (copyright). Same goes for the code, unless some company sponsors you and expects that in exchange.

The point of University research is not to distribute free source code so game developers can hack it and use it without spending any money... its the extension of the field of knowledge that's in question, and as someone said this can be accessed freely in the University's project database.

Imho, if you're going to come up with new ideas (which will be shared anyway), and implement them while at Uni (not earning any money), you should at least get some sort of compensation.



April 26, 2001, 10:44 AM

Well I actually quit my university before getting to my final year project. But the universtity (City Uni, London UK) did something similar. However, they also said that you are welcome to release it under a GNU license. The idea of research work being sidelined in a university where only students can get at it is completely nuts. The idea of university research (which is essentially what any final year project is) is to find things out and share what you find out with the community.

Am I the only one who thinks the inability to release source from what you do on a uni course is madness?

If my university tried that on me I would still have released it and asked them impolitely to stick there objections somewhere where the sun don't shine ;)


April 26, 2001, 02:03 PM

Hi iMalc. Well, antialiasing in CKCEd terrain edition mode has nothing to do with filtering or matrixes. Perhaps it's my fault and I fall in a misuse of terms.
I explain how it works and you'll be able to say me if there is a better way to call it.
The terrain edition is done with a circular cursor. Antialiasing goes for this cursor to do a blending between the desired elevation change an the current elevation in the map. So I build a cursor with floats ranging from 0 to 1. These values work as alpha values that indicates the amount of the desired elevation and the current elevation to be considered on the appliance of the cursor.

Linear and quadratic antialiasing refers to the way the mask is built. Linear antialiasing way generates a cursor that behaves like a cone (so the alpha variation from the center of the cursor to the bounds is lineal). Quadratic antialiasing generates a curor that behaves like a semisphere (so the variation is a quadratic function).

That's all. I hope to have make it clear. Ideas for renaming things will be attended.



April 26, 2001, 02:19 PM

The real situation on my Uni is that it reserves itself the commercial explotation rights. This make sense since you did your work with its mediums (licenses, computers, labs and so), or this is how it's intended to be; almost always you do the work at home leaving apart the mediums the University brings to you.

So, the commercial explotation on my University consists on let your work on a dark corner to get amounts of dust and spider webs. Frustrating. So usually the final year work consist on a bad gulp that you must overcome the fastest you can do.

It's not the worse thing you can find at my University. Per example, while all elementary schools have amount of PC's connected to the Internet, my faculty has amount of PC's and Sun Workstations in almost always closed laboratories (due to lack of personal), and continous threats of Internet access restrictions.

So, every University works in a different way. There are ones that works fine and other that works horribly bad. Do you know in which group is my University?



April 26, 2001, 05:41 PM

Cool IOTD! =)

It makes me feel very proud to see cool stuff posted by spanish speakers. Specially after such good comments.

Too bad about your university restrictions. Maybe you could post some pseudo-code somewhere?

Keep up the good work, Dan!

- Rolando

This thread contains 29 messages.
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.