Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Krice

Pages: [1] 2 3 ... 9
Off-topic (Locked) / Corona virus
« on: March 22, 2020, 10:56:25 AM »
It has not changed a lot in my case. I live in a small village in middle of Finland which is pretty much the last place it's going to hit. We have one confirmed death, but there will be more. I think Finland is a bit different than many other countries, because we have strong social distancing already, which I think has become a joke even. Where I live we have not run out of anything, not even toilet paper. At least not yet. I'm not afraid to get corona even though I'm not sure how it's going to affect me. Corona has already revealed interesting things about the modern society, we were certainly not ready for this and didn't act soon enough to stop traveling which in many countries was the main way of spreading. It's simply too easy to travel around the world (if you are wealthy enough to do that) and catch viruses.

Programming / Programming in C#
« on: February 22, 2020, 03:52:26 PM »
I'm trying again something different and use C# which is relatively new and unknown language to me. This time (I'm sure I've done this before!) I'm trying to create a simple "engine" for a roguelike using graphics for ascii tiles. My plan is print the ascii chars to an image and then use that. I could have put this in my blog, but it's such a hassle for code examples. And maybe I can share something I've learned.

First "funny" thing when you start with a Forms project is that when you create an initialization routine for the form you -have- to double click the form in the designer window. It auto-creates Form1_Load method which is linked to the form. You can't just write it. The reason for that is unknown. But you can then override the OnPaint which is an event called when the window is repainted. It's I think the way to implement output from the event side of the form. So in code it looks like this:

Code: [Select]
private void Form1_Load(object sender, EventArgs e)
Graphics g = CreateGraphics();
gui = new Gui(ref g);

protected override void OnPaint(PaintEventArgs pe)

You need "Graphics" to draw anything to a surface and in this case it's getting the surface from 'this' which is Form1 class (default name). Then I'm passing it as reference to Gui class which can use it to draw on the canvas of the form (another name for a window).

Off-topic (Locked) / Can I leave Finland?
« on: February 14, 2020, 04:28:27 PM »
I'm wondering. Winters are long even they are getting hotter from climate change (which by the way can be clearly experienced in arctic regions). There are no jobs and Finland too is taking in colored people. If I went to somewhere like Spain at least it's warm, even if everything else would stay the same. I guess most countries are worse than Finland, but they can't be all bad?

Design / Buildings
« on: October 19, 2019, 11:30:38 AM »
In a process of creating a building generation routine I'm wondering if anyone has tackled it before. Building as a group of rooms connected in some logical way. One way to do it is using seemingly random building blocks that fit together, but I think it would result in somewhat boring and predictable buildings. In fact when I try to remember games that have this I don't even know if they exist.

The way I'm thinking it would work is first decide what kind of rooms the building has and then somehow determine their locations and possible corridor style rooms between them. Funny thing about corridors is that afaik they are somewhat new invention. Buildings didn't use to have corridors in the past, rooms were just connected to each other.

Programming / License options for source code release
« on: May 23, 2019, 11:32:36 AM »
I'm planning to put a source code to github and I guess you need some kind of "license" for it, for americans. They are always so strict about those. I wouldn't want to use GPL of any sort, it's way too restrictive and I may even lose my own rights with it. In fact I wouldn't even call it a open source project, but in case someone wants to fork it I guess it's ok. But I suspect no one wants to touch it even with a ten foot pole. Is MIT license good in situations like this?

Off-topic (Locked) / On the Edge
« on: May 05, 2019, 06:32:59 AM »
I tried Microsoft's Edge browser since now when extensions in Firefox are disabled it's pretty much the same. Well, Edge has its own problems, like you can show (pin) the bookmark thingy, but you can't resize or move it to left side of the screen. Ah, 2019, the year of technology. But other than that it's quite ok, I think the font rendering in Edge is actually better than in Firefox for some reason. You can even disable Flash player manually. I wonder if there are addons like noscript and adblock for Edge as well? ps. I'm actually writing this message on Safari, but that's because I also have a mac mini.

Early Dev / Banana Rogue
« on: April 06, 2019, 10:25:53 AM »
I found Advanced Rogue's source code from random internet website and have been programming it to compile in modern C++. The experience so far has been quite positive. It's incredibly well programmed for that age and being C. The majority of the code compiles fine in C++11, but some things are giving trouble, like function pointers, malloc/free and some macros I think. The biggest task this far has been the missing declarations for functions. For some reason you didn't need those in ancient C compiler, just compile C files and functions are found somehow. Also, function pointers would be ok I guess, but C++ doesn't allow "free style" pointers where every kind of function can be passed in function pointer. C++ requires the function signature to match. But I have a plan to remove function pointers at least from 'options' module. I'm also going to rewrite some things, but try to keep C (procedural) style as much as possible.

Classic Roguelikes / Nethack 3.6.2
« on: February 04, 2019, 12:42:03 PM »
I think the drop style has changed to old school, when you select something it drops it without that + sign thing. Looting containers is now more complex for no reason, but whatever. Maybe there is some kind of change log somewhere, didn't read it. And when you throw something you have to select * for other than money, can't really understand why.

Sometimes I play Nethack and it's still quite nice. In fact what I like about it is the simplicity (at least in early game before the Quest), you don't have to do anything special, but you can. The current "run" I have with monk has been quite hilarious. I started by stealing a huge scroll shop in like second level of the dungeon, then escaped to gnomish mines and went to bottom level (the special level after mine town), almost got killed there by two vampires (the other one was a lord) that become out of vampire bats (I think it's a feature in that level). Luckily I had two orange potions which were full health potions. The I ran into a mumak which almost killed me. Then, back at the shop level I was almost killed by the shopkeeper, but I was able to go around it with a scroll of teleportation and continue to sokoban, where I'm now in the last level of it.

I've almost never played with a monk, but if you get AC low it's quite easy. I have only the original gloves and robe (improved with stolen scrolls of enchant armour), plus iron boots. No weapon, I think it's what you are supposed to do? AC is -2 and HP 70. Monk seems to be a ridiculously tough tank, you can bash through almost everything with it. Also, monk has healing spell as default which helps a lot.

Programming / HSL to RGB conversion
« on: January 14, 2019, 08:36:12 AM »
Just google it, right? Wrong. I can't find a C++ code for HSL-RGB and back conversion that actually works. I think I can get RGB to HSL work, because the values seem to be ok, but back to RGB fails.

Off-topic (Locked) / New year's resolutions for 2019
« on: January 03, 2019, 07:27:01 AM »
1. Eat less sugar, try to avoid it if possible.
2. Try to make some songs or demos at least (more like record and mix them, I have some songs ready in my head).
3. Release Teemu 1.3.
4. Finish modular design of Kaduria's source code.
5. Watch less random youtube videos.
6.  Try to improve posture by not slouching.

Programming / Metrics tools for C++
« on: November 30, 2018, 11:44:26 AM »
Any good free tools to calculate slightly more complicated metrics data (like number of classes) in a project? I have tried to find without luck. In fact I think writing such a tool yourself would not be super difficult, but I wouldn't want to waste my time on this if there are existing tools.

Programming / Three color problem
« on: September 06, 2018, 09:34:30 AM »
I have theme colors for fonts, font shadow and background, but I guess I'm too dumb to determine the shadow color from font color and background color. Sometimes the background is light and sometimes dark so fonts with dark/light color need darker or lighter shadow depending on.. something. The shadow color itself is also complementary, but it's easy to do with HSV color. I think it's easiest to use HSV and work with V or value (0-255) of it. I bet there is a simple formula to calculate the shadow intensity, maybe our AI bots could help in this, they got the intelligence, right?

Programming / How not to write C++
« on: July 22, 2018, 08:31:22 AM »
There is this older, I guess abandoned roguelike called Avanor. I was reading the source code and thought to remind people about how NOT to write C++ where Avanor is a great example. It's "easy" I guess to criticize an older project, but it's not that people wont make this mistake over again, they do it all the time.

The main problem with Avanor's code is that it's not C++, it's C wrapped in classes in a bad way. It's using none of OOP principles and in particular there are no traces of datatype classes, instead (almost) everything is plain old variables stuffed into large-ish classes. The code itself is old school large if/switch structures (typical in C code). I think Avanor points out perfectly the inability of a programmer to understand OOP (or any specific paradigm). If you just use classes to fill in with procedural code it's not OOP at all. Classes are only used as simple data containers, a lot like structs.

I think we need to make people somehow more aware of this issue, because it has a big impact on source code quality which can make the project fail after it becomes too difficult to maintain.

Off-topic (Locked) / RPG Codex forums
« on: May 23, 2018, 06:13:31 AM »
I visited Codex, I knew about it and I don't remember it well but I have even might been registered to it. Anyway the point is that reading that stuff gave me a flashback, a weird feeling that everything has happened before. You know, people arguing over what language is the best one, off-topic rambling and personal attacks. It all tells about the frustration that game development is for most people. And it's mostly in your mind, you are making it harder when you just try to push it through with your rigid ideas and ways to think about development.

I'm not saying "we" (older dudes of this forum) aren't just as bad, but still it's weird to look at it from another perspective.

Classic Roguelikes / Nethack 3.6.1
« on: May 01, 2018, 06:28:42 AM »
It's out now, but seems to be some kind of bug fix/feature freeze release. When I tried to run it Win10 smartscreen catched it.. well, I'm too suspicious to run it before other people try it on Windows.

Pages: [1] 2 3 ... 9