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.


Messages - requerent

Pages: 1 ... 8 9 [10] 11 12 ... 24
136
Programming / Re: pedantic object oriented question
« on: April 05, 2013, 07:22:50 PM »
The discussion becomes too abstract and laughable.

What is laughable is the way a personal view is more important than logical and analytic approach to programming.

Strousstrop arguing that the language he designed is better than the language it was designed with is an amusing way to suggest that it is objectively better.

You can achieve all the power with significantly more elegance with a combination of C and Lua- Lua being programmed in C is a subset of C so... it's really all just a varied expression of C. The fact that C++ attempts to be a super-set of C automatically works against the idea of compatibility, which results in new specifications to address every issue that results from this. If Strouss just created a new language altogether, without trying to build an object oriented paradigm on top of C, he would have something much more elegant and beautiful.

I've recently become incredibly interested in Language design and started a blog discussing a thing or two. http://requerent.blogspot.com/. Although I don't talk about the C vs C++ argument, I do cover some other general issues that we all experience with most programming languages today.

137
Programming / Re: pedantic object oriented question
« on: March 31, 2013, 04:53:51 PM »
Lua embedded in C will do everything that C++ does without obstruction and without compromise to speed. Algorithms in C, Data management in Lua-- it's really beautiful.

Uh oh.. I don't like the way this is going. Like I said, you need to forget your prejudice about C++/OOP. Only then you can understand why it is better than C.

Quote
This hilarious little tidbit from Linus Torvalds on C++ is a worthwhile read.
http://thread.gmane.org/gmane.comp.version-control.git/57643/focus=57918

Linus is a wrong person to talk about programming. He is just a lucky guy who invented Linux, but didn't really do any of the hard work that made Linux what it is today. Now he is a lazy millionaire and speaking all sorts of rubbish about programming, Windows etc. I wouldn't listen to that guy.

It's more useful, but we can't qualitatively say better.

Linus is just funny ^_^.

138
Programming / Re: pedantic object oriented question
« on: March 31, 2013, 10:12:53 AM »
It's much more important that something is implemented and works than that it is implemented "perfectly" or "correctly".

People who say that don't get the idea. The principles of OOP were not invented because they are "correct". During the years I have learned to use some of the OOP techniques while I feel there is less need for some others. What I see frequently are programmers who use everything without any good reason. In C++ it's usually overusing templates and inheritance. It's important to really understand OOP and how you can use it in a practical way. I think the difficulty of OOP is one of the reasons why strict OOP languages are not that good in programming real programs and why C++ is so popular, because it's multi-paradigm and you can break strict rules which is sometimes better and faster solution.

The only problem with OOP is that you cannot necessarily predict the scope of your program and all of it's use-cases without some degree of software engineering. For games, that's not simple without a clear design goals and game rules, which is hard for even AAA firms. What you say about C++ is true when it comes to breaking OOP when you need to, but it's equally obtuse and obstructive when you start talking about its utterly retarded type system and all of the "features."

Lua embedded in C will do everything that C++ does without obstruction and without compromise to speed. Algorithms in C, Data management in Lua-- it's really beautiful.

This hilarious little tidbit from Linus Torvalds on C++ is a worthwhile read.
http://thread.gmane.org/gmane.comp.version-control.git/57643/focus=57918

139
Programming / Re: pedantic object oriented question
« on: March 31, 2013, 04:48:33 AM »
I don't really buy into the concept anymore that anything in programming is better or worse than anything else. If it works, and it works well, and it isn't slow, then it's good. I'm sure everyone else disagrees with that, but it works well for me. The difference between theory and practice with programming is that practice is all about implementing something that works as quickly as possible (or in as small an amount of time as possible). It's much more important that something is implemented and works than that it is implemented "perfectly" or "correctly". The user doesn't know the difference between the two. All the user sees is whether or not something is implemented at all.

I'm not disagreeing, but of course a sloppy yet fast implementation today can easily slow you down later on ;)

That is definitely true for OOP, not necessarily true for other paradigms.

140
Programming / Re: pedantic object oriented question
« on: March 31, 2013, 03:13:37 AM »
Object-oriented design and video games aren't really the most logical fit in a conceptual sense. Strong type systems and inflexible hierarchies tend to get in the way of your ability to express what you want. You find yourself going back and fixing objects that result in cascading changes in how everything is done. This contradicts the idea of what a video game really is-- Nested tables of data, a collection of looping systems, and a UI.


There are bigger questions here though if you go the OO route. I always got buggered out because I could never really decide where methods should be and what objects should have access to what data. For ease of implementation, letting everything reference everything is a good way to get OO-principles from blocking your progress. This is bad OO, but I'm starting to hate OO to the point of trolling anyone who mentions it.

But yea- you want to be able to access WorldInfo from every actor in that world. All Actors (including wall tiles) should inherit from an actor base class with events like onBumped, onTick, and other junk that everyone overwrites so that everything can communicate with each other in a hunky-dory way. That's how it's done in industry.

Edit: To add- abstractly, all Actors can have a location and an owning Actor. GetLocation() would just return the location of the Owner, if it has one, otherwise it can return it's own location (which would should be set whenever the player drops/throws the item). Alternatively- the Owning Actor can have a set of ownedObjects. Each time the Actor moves, you can iterate through each object and update the position of those objects.

Are you programming in Python? Python has a lot of slick solutions to do this- though Lua, IMO, is infinitely more well-suited... though I wouldn't use traditional hierarchical OOP at all in either case.

141
Programming / Re: Bosses in a Low Health System
« on: March 30, 2013, 01:19:16 AM »
I agree that I don't like how ToMe does it. Bosses are generally just really tough mobs. Your strategy doesn't really change much- the fight just lasts longer and is more error-prone. To me this isn't intrinsically interesting.

Special rules are MUCH better than arbitrary scaling or challenge rating systems.

142
Programming / Re: Noob Timing - George read this! :-)
« on: March 30, 2013, 01:15:54 AM »
Who moves first into the tunnel behind you between a goblin and a dragon doesn't matter. First, the player won't bat an eye no matter who moves first. If you have a complicated system to determine that, the player isn't going to notice. Even if the goblin is directly behind you, the dragon is still only one tile away, and probably has magic and breath weapons and can still hit you. The goblin is going to be defeated very quickly leaving you with the dragon regardless of who goes in first. If you run, the only place you can run to is another room where both can hit you at the same time.

The player just isn't going to bat an eye at the goblin or the dragon going first. It's just not something that gets noticed or thought about. Even if it did, it isn't helpful in this or other situations.

I guess it isn't obvious.

Original situation (A).
Code: [Select]
g@D
#.#

If goblin moves first (B).
Code: [Select]
.gD
#@#

If Dragon moves first (C).
Code: [Select]
gD.
#@#

The tactical decision to move to A in the first place depends on whether we can ensure the outcome of B over C. There is an implication that it is favorable to be as far from a dragon as possible- or to not allow the Dragon to have LOS to you. Either way- order matters.

143
Programming / Re: Noob Timing - George read this! :-)
« on: March 29, 2013, 10:48:02 PM »
I feel obligated to reply, but since I'm no expert at roguelike timing (I can just read lots of rgrd archives ;) ), luckily I don't feel like I have to make insightful observations.

Though I would like to hear more about that powers-of, I don't quite follow how that works.

I don't think powers-of is specifically used by anybody since I haven't actually read about it being used prior to mentioning it in a few threads. To me, it's intuitive and obvious and I assume most people already use something similar for that reason-- I come from a GUI background, so user-experience and comprehension, to me, is always the most important aspect of an application.

A problem with roguelikes is maintaining chronological consistency between entities in a comprehensible way. That is, the player's perception of the rate at which objects moves may not reflect the way the engine works. A speed of 100 and 99 are virtually the same in regards to ticks, but on that 100th tick the player's inference is shown to be arbitrarily wrong when one entity seems to get a free action.

For example, if you have an Orc with speed 10 and a Unicorn with speed 11- every 10 turns the unicorn will appear to perform an extra action. This inconsistency isn't easy to communicate in a meaningful way to a player in a turn-based game. In a real-time game, you can have all the arbitrary timing things you want- but in turn-based, you just can't get away with it unless you have some really slick graphics (that communicate subtle differences of speed via tweening).

A simple solution is to base your timing system on powers-of some base. So that a speed of 0 = b^0, speed of 1 = b^1, speed of 2 = b^2- etc. This ensures that all aspects of the timing system align in a coherent way. This can allow you to implement asynchronous timing schemes without losing coherence (that is, turn-order can change, but the meaningfulness of each action is measurable). If you perceive that an orc makes actions at half the speed that you do, you can infer that a special ability that moves at half your current speed won't incur any hidden or imperceptible/unexpected penalty- like a free hit- which could be the case in the speed 10/11 issue.

In this sense, you can use powers-of with a tick-based system and priority queue and ensure that all elements of the timing system function in an expected way. This can have far reaching implications if you choose to simulate simple physics- like being able to step out of the way of an arrow if you can move fast enough- and other aspects.

It's really just about applying a standards to a tick-based system so that the player isn't forced to think about timing elements that only obfuscate the fun of the actual game. I personally feel that the benefit of a powers-of system is much better, because the rules are consistent. If one object moves 3x faster and another moves 5x faster- we're already getting into largest common factors for referencing the sensation of a complete 'cycle' of actions. If everything shares a common divisor, these inconsistencies won't exist. IMO- Flexibility is less important than coherence.

144
Programming / Re: Noob Timing - George read this! :-)
« on: March 29, 2013, 03:17:16 PM »
g = Goblin, D = Dragon, @ = you.


You move south. The enemy that occupies the tile directly north of you, after you move south, is of incredible importance.

145
Programming / Re: combat/conflict resolution system development
« on: March 29, 2013, 03:06:20 PM »
I like that. For a roguelike it would just need to be more scaleable so the player doesn't randomly die all the time.

146
Programming / Re: SQL Database
« on: March 29, 2013, 03:02:48 PM »
Games are just Databases with a UI.


I'd recommend looking into Entity Systems or component-based systems. They're designed to translate easily into tables- works quite naturally with lua and sql and are incredibly extensible.

Not a great resource, but find some links to articles/papers on the subject. They're pretty eye-opening.
http://entity-systems.wikidot.com/

147
Programming / Re: Noob Timing - George read this! :-)
« on: March 29, 2013, 02:59:48 PM »
You don't really need to know the order in which monsters commit actions within a single turn because from the player's perspective everything during a turn happens all at once, and it really won't be noticeable to have a more complicated system to determine who goes first.

I don't know about that.

Code: [Select]
g@D
#.#
#.#
#.#

148
Programming / Re: "Event driven" roguelike architecture question
« on: March 29, 2013, 02:57:06 PM »
Are you familiar with event-architecture at all? I mean, do you need an explanation of how it works or simply how it would work in a turn-based game?


149
Programming / Re: Bosses in a Low Health System
« on: March 29, 2013, 02:44:01 PM »

The number and complexity of solutions roughly represents the difficulty of any problem.

If a problem requires an order of magnitude more complexity with little change to the quantity of solutions, you have yourself a Boss.

150
Programming / Re: "Event driven" roguelike architecture question
« on: March 29, 2013, 06:11:07 AM »
Depends on how you represent time. ADOM uses something like 1000 ticks per turn IIRC. You would just put everything in a priority queue and simulate-- calling events as per a real-time system.

Pages: 1 ... 8 9 [10] 11 12 ... 24