Article about Lighting in "A Valley Without Wind"

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: Article about Lighting in "A Valley Without Wind"

Post by TechnoCat »

Jasoco wrote:[stuff about text editors]
Certainly, use your favorite one.
Jasoco wrote:Also, why did this go off-topic? No one liked my demonstration at all? At all? No one? At all? Disappointment am total. :cry:
I liked it, especially how between two areas it looks very fluid. It is just the perimeter of the circle suffers a bit.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Article about Lighting in "A Valley Without Wind"

Post by Jasoco »

Robin wrote:
Jasoco wrote:And Sublime looks promising but then again costs $60.
I recently started using Sublime Text. I didn't pay a dime for it. Not going to either.
So, what? Is it one of those "free unless you want to pay" apps? What doesn't it have in the free version that it does in the $60 one? What makes it worth $60? IMHO, I'd just use NotePad or TextEdit if I were required to pay for every coding app. And I did... back in the 90's. At that time I was also using QBASIC in DOS in Windows.
Robin wrote:
Jasoco wrote:I don't even see any functions popup or list in Sublime.
Ctrl+Space gives a pop-up. Plus it has snippets and whatnot.
It doesn't show just functions in a list? All I get is a list of everything, all variables, strings, etc in one big list that becomes extremely unmanagable. Is there no simple function only list?
Robin wrote:
Jasoco wrote:So TextWrangler I stick with. If you don't like my coding style, sorry. But I code how I like to code. I didn't take any classes on coding. I do this for fun and teach myself. And I type a lot, so the less characters I have to type, the better I feel. Next time I'll remember to replace all my shortcuts with longcuts... maybe. But I don't guarantee anything. Get off my lawn!
It isn't a problem as long as the code doesn't get unmaintainable. It might help keeping the following two questions in mind:
  1. If you stop working on a project and come back to it after a year or so, would you able to read what you wrote and pick the process right up again?
  2. If you start collaborating with someone else, would they be able to get cracking right away?
Yes. Either that or I only come back for ideas and rewrite it a different way using methods I had learned from that year. So far the only HUGE project I have is my Adventure engine. And I'm even planning on rewriting that one too. But not because it's unmanagable, but because it was my earliest project and uses methods different from conventions I use now/stuff I've learned since starting it.
Robin wrote:
Jasoco wrote:Also, why did this go off-topic? No one liked my demonstration at all? At all? No one? At all? Disappointment am total. :cry:
I liked it, it had some artefacts, though, which was too bad. Maybe that can be fixed?
Well, it's a thrown together prototype. If it could have alpha transparency in the framebuffers (i.e. instead of solid circles I'd use images with a circular gradient) it could be so much more. The only reason it's rough around the edges is because of the lack of what was it called? "Premultiplied blend mode". We need that if it does what I am thinking it does. IMHO, and I know it's probably not conventional, I think framebuffers should be treated like an empty transparent image that you draw on using whatever alpha levels you want. Basically draw() a PNG onto it, or a line with smooth edges and it won't get rough white backgrounded edges where the partially transparent pixels are.

It's also the reason I can't use the Rich Text library. Because all the text gets white roughness around it. And at the time I didn't know why until I started using framebuffers.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Article about Lighting in "A Valley Without Wind"

Post by kikito »

Hi there,
No one liked my demonstration at all? At all? No one? At all? Disappointment am total.
I liked how it looked. Except for the small artifacts that Robin mentioned. I wanted to read the code in order to understand where the artifacts were coming from, but I could not get my bearings.

I also appreciate that you brought the issue of the "semi-transparent png drawn on buffer doesn't make buffer transparent". I would not have picked it. But since it is already on the issue tracker and all, I don't think there's an easy way to use framebuffers to have this effect. The only way might be drawing all the circles, each time.
Also, why did this go off-topic?
Well, I started it, I think. Please forgive me if I keep off-topic for a bit more. I think this is important.

[off-topic]
It is great that you have been able to write that much code on your own, without taking any classes. But programming isn't just telling the computer what to do. It's telling other people what you want the computer to do ("other people", incidentally, includes your future self). Using proper names with appropiate length is critical. The best resource I know on choosing programming names is this video from cleancoders.com. It's $12, but it is totally worth it. (And yes, that's a katana. On the third video he dresses like Darth Vader and sings a love song. To his dog. For real.)

That same guy has a book called Clean Code which I totally recommend.

I plead innocent on the editor thing - you opened that can of worms yourself :) (you may have written "tabs are much better than spaces" instead) . If you don't like typing very much, then autocompletion is the logical thing to use. Not two-letter names.

I think that Textwrangler has one autocomplete function, but I'm not sure whether it works for macs.
[/off-topic]
When I write def I mean function.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: Article about Lighting in "A Valley Without Wind"

Post by TechnoCat »

Jasoco wrote:So, what? Is it one of those "free unless you want to pay" apps? What doesn't it have in the free version that it does in the $60 one? What makes it worth $60? IMHO, I'd just use NotePad or TextEdit if I were required to pay for every coding app. And I did... back in the 90's. At that time I was also using QBASIC in DOS in Windows.
Unfortunately (or fortunately), it is in a free public alpha phase right now. It is 60$ normally.
Jasoco wrote:It doesn't show just functions in a list? All I get is a list of everything, all variables, strings, etc in one big list that becomes extremely unmanagable. Is there no simple function only list?
In a c file, if i type "ex[ctrl+space]" I get a list of exit, extract, and executing.

Also, I added this to my lua syntax file in sublime to syntax highlight all of love's modules:

Code: Select all

		<!-- LOVE FUNCTION -->
		<dict>
			<key>match</key>
			<string>(love\.(audio|event|filesystem|font|graphics|image|joystick|keyboard|mouse|physics|sound|thread|timer))</string>
			<key>name</key>
			<string>support.function.library.lua</string>
		</dict>
and sublime also has a fairly extendable python api for plugins. I'm using one right now to do indentation guidelines (A feature I cannot live without anymore)
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Article about Lighting in "A Valley Without Wind"

Post by Jasoco »

kikito wrote:Hi there,
No one liked my demonstration at all? At all? No one? At all? Disappointment am total.
I also appreciate that you brought the issue of the "semi-transparent png drawn on buffer doesn't make buffer transparent". I would not have picked it. But since it is already on the issue tracker and all, I don't think there's an easy way to use framebuffers to have this effect. The only way might be drawing all the circles, each time.
That's not very good though. The only reason I used framebuffers was because if the darkness needs to be partially transparent (i.e. you can see the ground under it partially) you need to be able to draw onto one plane at 100% opaque, then draw that plane onto the main plane at partial transparency. Because if you don't, you can't have partial "fog".

The last alternative is to have ugly aliased multiple layers of circles at different sizes drawn onto framebuffers then drawn onto the main screen, but my goodness would that take up more FPS than it should.

Know what I mean? We need this. Else we're so limited.
TechnoCat wrote:
Jasoco wrote:It doesn't show just functions in a list? All I get is a list of everything, all variables, strings, etc in one big list that becomes extremely unmanagable. Is there no simple function only list?
In a c file, if i type "ex[ctrl+space]" I get a list of exit, extract, and executing.[/space]
That wouldn't help me jump to a function I already wrote. I need a list. That I can click. And select from. Also, Control is a very hard key for me to press when trying to also hit Space. It'd make me so frustrated I'd switch back to TW after a day.

It's obvious my requirements for a text editor are much higher than you all think, and I'm not switching from TextWrangler. So y'all can stop suggesting editors.
User avatar
sharpobject
Prole
Posts: 44
Joined: Fri Mar 18, 2011 2:32 pm
Location: California

Re: Article about Lighting in "A Valley Without Wind"

Post by sharpobject »

Jasoco wrote:And the latest Mac version is from the PPC era, which won't even work on Lion anyway.

Code: Select all

dripping:MacOS robert$ cd /Applications/MacPorts/MacVim.app/Contents/MacOS/
dripping:MacOS robert$ file MacVim
MacVim: Mach-O 64-bit executable x86_64
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Article about Lighting in "A Valley Without Wind"

Post by Jasoco »

sharpobject wrote:
Jasoco wrote:And the latest Mac version is from the PPC era, which won't even work on Lion anyway.

Code: Select all

dripping:MacOS robert$ cd /Applications/MacPorts/MacVim.app/Contents/MacOS/
dripping:MacOS robert$ file MacVim
MacVim: Mach-O 64-bit executable x86_64
Good to know, but the program is still just a terminal application in an OS X wrapper without any kind of OS-specific features. It would be the very last program I would use to create my game even behind using EDIT.EXE in DOS.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Article about Lighting in "A Valley Without Wind"

Post by Robin »

Jasoco wrote:
Robin wrote:Ctrl+Space gives a pop-up. Plus it has snippets and whatnot.
It doesn't show just functions in a list? All I get is a list of everything, all variables, strings, etc in one big list that becomes extremely unmanagable. Is there no simple function only list?
Unfortunately, Lua is a dynamically typed language, so there's no good way for ST to know which from the names used are functions.
Jasoco wrote:Also, Control is a very hard key for me to press when trying to also hit Space.
You could edit the shortcut.
Jasoco wrote:It's also the reason I can't use the Rich Text library. Because all the text gets white roughness around it. And at the time I didn't know why until I started using framebuffers.
Yeah, I didn't know that either. In my simple tests with white on black, nothing bad happened of course. You could use RT without framebuffers (it's a simple boolean switch), but that would probably get a bit expensive.

EDIT: I'll stop talking about editors by the way. I don't even like Sublime Text that much. I'm trying it out, because I'm sort of stuck on Gnome, and Kate doesn't play that well with it.
Help us help you: attach a .love.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Article about Lighting in "A Valley Without Wind"

Post by Jasoco »

Robin wrote:
Jasoco wrote:
Robin wrote:Ctrl+Space gives a pop-up. Plus it has snippets and whatnot.
It doesn't show just functions in a list? All I get is a list of everything, all variables, strings, etc in one big list that becomes extremely unmanagable. Is there no simple function only list?
Unfortunately, Lua is a dynamically typed language, so there's no good way for ST to know which from the names used are functions.
TextWrangler does it. It lists them all including functions inside tables. Including named functions and anonymous ones.
aG7lh.png
aG7lh.png (28.8 KiB) Viewed 209 times
Jasoco wrote:It's also the reason I can't use the Rich Text library. Because all the text gets white roughness around it. And at the time I didn't know why until I started using framebuffers.
Yeah, I didn't know that either. In my simple tests with white on black, nothing bad happened of course. You could use RT without framebuffers (it's a simple boolean switch), but that would probably get a bit expensive.
Yeah. Shame. This is a feature that would be very useful. Can RichText work with image fonts by the way? (I ask because the fonts I use in my 16-bit style games are unaliased bit fonts in the style of SNES graphics so alpha transparency wouldn't be required anyway)
EDIT: I'll stop talking about editors by the way. I don't even like Sublime Text that much. I'm trying it out, because I'm sort of stuck on Gnome, and Kate doesn't play that well with it.
Agreed. I won't mention it again. Let's stay on track. :) Who's Kate? Other than the girl in my avatar that is...
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Article about Lighting in "A Valley Without Wind"

Post by Robin »

Jasoco wrote:TextWrangler does it. It lists them all including functions inside tables. Including named functions and anonymous ones.
Oh, wow, that's pretty cool!
Jasoco wrote:Can RichText work with image fonts by the way?
No idea, never tried. I think it does, though. I don't see any reason why not.
Jasoco wrote:Who's Kate? Other than the girl in my avatar that is...
KDE Advanced Text Editor. So yeah, let's stay on track. ;)
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests