• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 19:17
CET 00:17
KST 08:17
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
ByuL: The Forgotten Master of ZvT30Behind the Blue - Team Liquid History Book19Clem wins HomeStory Cup 289HomeStory Cup 28 - Info & Preview13Rongyi Cup S3 - Preview & Info8
Community News
BGE Stara Zagora 2026 cancelled10Blizzard Classic Cup - Tastosis announced as captains12Weekly Cups (March 2-8): ByuN overcomes PvT block4GSL CK - New online series18BSL Season 224
StarCraft 2
General
BGE Stara Zagora 2026 cancelled BGE Stara Zagora 2026 announced ByuL: The Forgotten Master of ZvT Terran AddOns placement Blizzard Classic Cup - Tastosis announced as captains
Tourneys
StarCraft Evolution League (SC Evo Biweekly) [GSL CK] Team Maru vs. Team herO WardiTV Team League Season 10 Master Swan Open (Global Bronze-Master 2) RSL Season 4 announced for March-April
Strategy
Custom Maps
Publishing has been re-enabled! [Feb 24th 2026] Map Editor closed ?
External Content
The PondCast: SC2 News & Results Mutation # 516 Specter of Death Mutation # 515 Together Forever Mutation # 514 Ulnar New Year
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ ASL21 General Discussion BW General Discussion Gypsy to Korea Are you ready for ASL 21? Hype VIDEO
Tourneys
[Megathread] Daily Proleagues [BSL22] Open Qualifiers & Ladder Tours IPSL Spring 2026 is here! ASL Season 21 Qualifiers March 7-8
Strategy
Simple Questions, Simple Answers Soma's 9 hatch build from ASL Game 2 Fighting Spirit mining rates Zealot bombing is no longer popular?
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread PC Games Sales Thread No Man's Sky (PS4 and PC)
Dota 2
Official 'what is Dota anymore' discussion The Story of Wings Gaming
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Five o'clock TL Mafia Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia TL Mafia Community Thread
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Mexico's Drug War NASA and the Private Sector
Fan Clubs
The IdrA Fan Club
Media & Entertainment
Movie Discussion! [Req][Books] Good Fantasy/SciFi books [Manga] One Piece
Sports
Formula 1 Discussion 2024 - 2026 Football Thread General nutrition recommendations Cricket [SPORT] TL MMA Pick'em Pool 2013
World Cup 2022
Tech Support
Laptop capable of using Photoshop Lightroom?
TL Community
The Automated Ban List
Blogs
Iranian anarchists: organize…
XenOsky
FS++
Kraekkling
Shocked by a laser…
Spydermine0240
Gaming-Related Deaths
TrAiDoS
Unintentional protectionism…
Uldridge
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1593 users

The Big Programming Thread - Page 163

Forum Index > General Forum
Post a Reply
Prev 1 161 162 163 164 165 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
Sub40APM
Profile Joined August 2010
6336 Posts
September 04 2012 05:47 GMT
#3241
Ya so, wasypants has a good point. If you want to 'truly' understand you should start with a language that builds everything up from scratch. But do you have the willpower to grind through that? Because like he also said, with python you can be doing legitimately useful programs from almost day 1 and ya there will be an element of 'magic' to it in the sense that you wont actually know how what you ordered python to do worked under the hood...

I have known many more people who gave up on C and general programming than Python...
phar
Profile Joined August 2011
United States1080 Posts
September 04 2012 07:25 GMT
#3242
I would argue that to get someone interested in programming, you shouldn't hit them with a sledgehammer (C) to begin with. Attrition is going to be a lot lower if you start out actually making stuff, instead of spending 95% of your time fighting with gcc.

I would also argue that C is not a bottom-up approach. If you really want to understand wtf is going on, go like... E&M -> transistors -> architecture -> C. But, not everybody is going to want to learn the really low-level stuff. There are some people who find it fascinating (I am one of those people), but people think it's boring as ungodly fuck.

Also, most of the low level shit just does not matter for 99.9% of the software you do at a high level. Being able to modularize your code, use good designs, and make it readable so other people can mess with it is much more important (where "other people" == "you in 6 months", after you've completely forgotten wtf those 10k loc do).



All that said, if you continue programming, you really should learn C eventually because it's good for you :p
Who after all is today speaking about the destruction of the Armenians?
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 04 2012 07:34 GMT
#3243
anyone have any tips on learning Java?

I come from a strong Lisp (Scheme specifically) background and I know Python fairly well in addition. I need to learn Java this semester. Very basic general stuff can be helpful for me. I like knowing the constraints or specifics of a language regarding its very basic ideas: things like, in Lisp everything has the value #t except for #f, whether doing tail-recursion has any benefits over regular recursion, (in Python tail-recursion has no benefit) syntax things to consider (parentheses in Lisp anyone? Also the fucking colons after all the loops in Python kept screwing me over lol)
Tobberoth
Profile Joined August 2010
Sweden6375 Posts
September 04 2012 07:54 GMT
#3244
On September 04 2012 16:34 wherebugsgo wrote:
anyone have any tips on learning Java?

I come from a strong Lisp (Scheme specifically) background and I know Python fairly well in addition. I need to learn Java this semester. Very basic general stuff can be helpful for me. I like knowing the constraints or specifics of a language regarding its very basic ideas: things like, in Lisp everything has the value #t except for #f, whether doing tail-recursion has any benefits over regular recursion, (in Python tail-recursion has no benefit) syntax things to consider (parentheses in Lisp anyone? Also the fucking colons after all the loops in Python kept screwing me over lol)

Generally, I'd say you'll want "high-level" books since you already know how to program and prefer the more technical aspects... I guess an o'rielly book or something like that.

It's also possible that Java has something like all of microsofts products, certification tests etc. The books etc for those, are the SHIT. Since the company which developed the framework etc aims to get you certified, they teach more or less everything from the ground up. Instead of going "How to start coding in X" you go "How to know everything about X".
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 04 2012 08:43 GMT
#3245
On September 04 2012 16:54 Tobberoth wrote:
Show nested quote +
On September 04 2012 16:34 wherebugsgo wrote:
anyone have any tips on learning Java?

I come from a strong Lisp (Scheme specifically) background and I know Python fairly well in addition. I need to learn Java this semester. Very basic general stuff can be helpful for me. I like knowing the constraints or specifics of a language regarding its very basic ideas: things like, in Lisp everything has the value #t except for #f, whether doing tail-recursion has any benefits over regular recursion, (in Python tail-recursion has no benefit) syntax things to consider (parentheses in Lisp anyone? Also the fucking colons after all the loops in Python kept screwing me over lol)

Generally, I'd say you'll want "high-level" books since you already know how to program and prefer the more technical aspects... I guess an o'rielly book or something like that.

It's also possible that Java has something like all of microsofts products, certification tests etc. The books etc for those, are the SHIT. Since the company which developed the framework etc aims to get you certified, they teach more or less everything from the ground up. Instead of going "How to start coding in X" you go "How to know everything about X".


Yeah so our "official" book is Head First Java (O'Reilly) and it's been recommended we check out the Gosling reference (since he created the language). I take it O'Reilly's text is a good book?

This stuff is a bit foreign to me as I didn't really use a text to learn Python and I used MIT's text to learn Scheme.
phar
Profile Joined August 2011
United States1080 Posts
Last Edited: 2012-09-05 04:05:40
September 05 2012 04:04 GMT
#3246
On September 04 2012 16:34 wherebugsgo wrote:
anyone have any tips on learning Java?

I come from a strong Lisp (Scheme specifically) background and I know Python fairly well in addition. I need to learn Java this semester. Very basic general stuff can be helpful for me. I like knowing the constraints or specifics of a language regarding its very basic ideas: things like, in Lisp everything has the value #t except for #f, whether doing tail-recursion has any benefits over regular recursion, (in Python tail-recursion has no benefit) syntax things to consider (parentheses in Lisp anyone? Also the fucking colons after all the loops in Python kept screwing me over lol)

Do you know C at all? If you know C, you already know many of the basic constraints in java, especially if you're talking about syntax. If you're any decent at the proper OO constructions in python, it won't be that hard to transition into java.

The official sun tutorials are pretty decent for a first start:

http://docs.oracle.com/javase/tutorial/

s/sun/oracle/


There's an excellent reference - Effective Java, but I'm not sure it's suitable for learning the basics. It's by Joshua Bloch, who wrote significant portions of the java language (the good parts too :p).

Yea reading through bits of it right now, doesn't seem like it'd be that useful for you. Start with a basic text or the official tutorials and see how it goes.


I also strongly suggest that you start off on the right foot and follow an actual style guide (pick one), even while you're first learning. It won't teach you anything about the language itself, but it will help other people be able to help you with your code when you inevitably have to ask for help (everyone does).

official one: http://www.oracle.com/technetwork/java/javase/documentation/codeconvtoc-136057.html



Really though, just start hacking with it. Reading a book or guide isn't gonna go that far. Mess around, build shit, break stuff, ask for help.
Who after all is today speaking about the destruction of the Armenians?
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 05 2012 07:50 GMT
#3247
yeah, I have 0 experience with C. Having programmed a bit in Java today (I finished a few small functions, one that finds sociable pairs) I feel more comfortable, but it's still a little weird having to denote what variables are before using them and whatnot.

Thanks for the references! I'll definitely check them out.
Frigo
Profile Joined August 2009
Hungary1023 Posts
September 05 2012 09:24 GMT
#3248
I also advise you to read Clean Code and learn how to use Eclipse and its various refactor options.
http://www.fimfiction.net/user/Treasure_Chest
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 05 2012 15:43 GMT
#3249
On September 05 2012 18:24 Frigo wrote:
I also advise you to read Clean Code and learn how to use Eclipse and its various refactor options.


Don't think I'll be using Eclipse, I like emacs too much :p
LukeNukeEm
Profile Joined February 2012
31 Posts
Last Edited: 2012-09-06 00:49:37
September 05 2012 23:38 GMT
#3250
Has anyone here implemented an Octree into a raytracer/pathtracer or something similar? I'm getting somewhat frustrated T_T

edit: as usual, you try to find the answer on your own for hours and get nothing. then you post your question and find the answer on your own 5 minutes later. ^_^
DarkGeneral
Profile Blog Joined September 2003
Canada328 Posts
Last Edited: 2012-09-06 00:05:16
September 06 2012 00:01 GMT
#3251
Hello TL Programmers

A few weeks ago I decided that I wanted to learn and master HTML/CSS/Javascript and SQL.

To solidify my learnings as I went forward, I started a web based game project.

My project is Knights of Drakon, a top down oldschool RPG written entirely in JavaScript/html/css.
Link to my game

The reason I come here is to ask for some advice from seasoned programmers regarding certain game parts.

Im gonna just ask my questions and hope someone will answer

1. How do I code an Armor mitigation function/class?
For example the player has 112 armor, and is level 4, the enemy is lvl 6. How do I make it that 112 turns into a certain % reduction?
such that more player/monster level difference affects the % and also the more the static armor, the less stacking effect it has, such as a diminishing return or a softcap

2. Same as above for a dodge system.

3. Whats the best way to code a turn based 1v1 combat versus a monster. Player attacks, then the monster attacks, so on so forth, untill one is dead. I know this one is a broad scope question, But ANY idea and input is greatly appreciated




Furthermore and possibly off topic, I have my hands full and would appreciate people partnering up with me and contributing to the site, Id love experienced people in all backgrounds, Arists, Coders, Webmaster, Gamedesigners, Level Designers, and someone to help me set up forums for the project, email me from the site or PM here

Thanks TL

"Everybody gotta die some time, righ'?" - Wraith Pilot
LukeNukeEm
Profile Joined February 2012
31 Posts
Last Edited: 2012-09-06 00:28:08
September 06 2012 00:27 GMT
#3252
On September 06 2012 09:01 DarkGeneral wrote:
1. How do I code an Armor mitigation function/class?
For example the player has 112 armor, and is level 4, the enemy is lvl 6. How do I make it that 112 turns into a certain % reduction?
such that more player/monster level difference affects the % and also the more the static armor, the less stacking effect it has, such as a diminishing return or a softcap


You could do something like:
dmgModifier = 100 / (100 + armor);
dmgOut = dmgModifier * dmgIn;

Adjust the numbers to what you feel works best for you.


DarkGeneral
Profile Blog Joined September 2003
Canada328 Posts
September 06 2012 00:46 GMT
#3253
On September 06 2012 09:27 LukeNukeEm wrote:
Show nested quote +
On September 06 2012 09:01 DarkGeneral wrote:
1. How do I code an Armor mitigation function/class?
For example the player has 112 armor, and is level 4, the enemy is lvl 6. How do I make it that 112 turns into a certain % reduction?
such that more player/monster level difference affects the % and also the more the static armor, the less stacking effect it has, such as a diminishing return or a softcap


You could do something like:
dmgModifier = 100 / (100 + armor);
dmgOut = dmgModifier * dmgIn;

Adjust the numbers to what you feel works best for you.




Sweet, I like that. Any ideas on how to play level difference into this calculation?
"Everybody gotta die some time, righ'?" - Wraith Pilot
LukeNukeEm
Profile Joined February 2012
31 Posts
September 06 2012 00:53 GMT
#3254
On September 06 2012 09:46 DarkGeneral wrote:
Show nested quote +
On September 06 2012 09:27 LukeNukeEm wrote:
On September 06 2012 09:01 DarkGeneral wrote:
1. How do I code an Armor mitigation function/class?
For example the player has 112 armor, and is level 4, the enemy is lvl 6. How do I make it that 112 turns into a certain % reduction?
such that more player/monster level difference affects the % and also the more the static armor, the less stacking effect it has, such as a diminishing return or a softcap


You could do something like:
dmgModifier = 100 / (100 + armor);
dmgOut = dmgModifier * dmgIn;

Adjust the numbers to what you feel works best for you.




Sweet, I like that. Any ideas on how to play level difference into this calculation?


Just do the same thing again - pretend that each level is worth 50 armor or so. either work it in the existing modifier, or create a new one and multiply both, e.g:
lvlDiffModifier = 100 / (100 + 50 * lvlDiff);
dmgOut = armorModifier * lvlDiffModifier * dmgIn
Brutland
Profile Joined February 2011
United States92 Posts
Last Edited: 2012-09-06 00:57:05
September 06 2012 00:54 GMT
#3255
dmgMod= LvlMod*(100/(100+cArmor)
dmgOut=dmgIn*dmgMod

LvlMod= abs(charLvl-oppLvl)*whatever percent or modifying fn here
"I drank What?"
LukeNukeEm
Profile Joined February 2012
31 Posts
September 06 2012 00:57 GMT
#3256
On September 06 2012 09:54 Brutland wrote:
dmgMod= abs((oppLvl-charLvl))*(100/(100+cArmor)
dmgOut=dmgIn*dmgMod


this would result in getting the same modifiers for lvl4 vs lvl6 / lvl 6 vs lvl 4
Craton
Profile Blog Joined December 2009
United States17281 Posts
September 06 2012 01:09 GMT
#3257
On September 05 2012 16:50 wherebugsgo wrote:
yeah, I have 0 experience with C. Having programmed a bit in Java today (I finished a few small functions, one that finds sociable pairs) I feel more comfortable, but it's still a little weird having to denote what variables are before using them and whatnot.

Thanks for the references! I'll definitely check them out.

It feels weird as hell not to when you started the other way.
twitch.tv/cratonz
DarkGeneral
Profile Blog Joined September 2003
Canada328 Posts
September 06 2012 01:10 GMT
#3258
On September 06 2012 09:53 LukeNukeEm wrote:
Show nested quote +
On September 06 2012 09:46 DarkGeneral wrote:
On September 06 2012 09:27 LukeNukeEm wrote:
On September 06 2012 09:01 DarkGeneral wrote:
1. How do I code an Armor mitigation function/class?
For example the player has 112 armor, and is level 4, the enemy is lvl 6. How do I make it that 112 turns into a certain % reduction?
such that more player/monster level difference affects the % and also the more the static armor, the less stacking effect it has, such as a diminishing return or a softcap


You could do something like:
dmgModifier = 100 / (100 + armor);
dmgOut = dmgModifier * dmgIn;

Adjust the numbers to what you feel works best for you.




Sweet, I like that. Any ideas on how to play level difference into this calculation?


Just do the same thing again - pretend that each level is worth 50 armor or so. either work it in the existing modifier, or create a new one and multiply both, e.g:
lvlDiffModifier = 100 / (100 + 50 * lvlDiff);
dmgOut = armorModifier * lvlDiffModifier * dmgIn


Beautiful simplcity,

now for the last aspect, how would I implement diminishing returns?

As the number increases and the % approaches lets say 70% the % amount per armor point would have to curve down, what is the best way to do that?
"Everybody gotta die some time, righ'?" - Wraith Pilot
phar
Profile Joined August 2011
United States1080 Posts
September 06 2012 04:16 GMT
#3259
On September 06 2012 00:43 wherebugsgo wrote:
Show nested quote +
On September 05 2012 18:24 Frigo wrote:
I also advise you to read Clean Code and learn how to use Eclipse and its various refactor options.


Don't think I'll be using Eclipse, I like emacs too much :p

Eclipse is a huge timesaver for Java. If you're not going to be writing that much code it won't matter, but if you have to crank out like 4k loc a week, Eclipse helps with the RSI :\

If this is for ar Uni class, just use whatever you're most comfortable with. But the default auto complete / auto import / auto getter/setter /etc stuff that's built in to Eclipse is really handy.
Who after all is today speaking about the destruction of the Armenians?
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 06 2012 05:46 GMT
#3260
On September 06 2012 13:16 phar wrote:
Show nested quote +
On September 06 2012 00:43 wherebugsgo wrote:
On September 05 2012 18:24 Frigo wrote:
I also advise you to read Clean Code and learn how to use Eclipse and its various refactor options.


Don't think I'll be using Eclipse, I like emacs too much :p

Eclipse is a huge timesaver for Java. If you're not going to be writing that much code it won't matter, but if you have to crank out like 4k loc a week, Eclipse helps with the RSI :\

If this is for ar Uni class, just use whatever you're most comfortable with. But the default auto complete / auto import / auto getter/setter /etc stuff that's built in to Eclipse is really handy.


yeah so it's for a university class (UC Berkeley) and our "official" text editor is emacs. We have been told that we can use Eclipse if we want to, but our prof made a list of things he hates about Eclipse and most of us learned on vim/emacs anyway so it's not a huge deal.

Prev 1 161 162 163 164 165 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 43m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft218
ProTech130
JuggernautJason106
StarCraft: Brood War
NaDa 22
Jaeyun 5
Dota 2
monkeys_forever300
capcasts90
Counter-Strike
minikerr8
Heroes of the Storm
Liquid`Hasu335
Other Games
summit1g11625
Grubby3978
FrodaN3552
shahzam612
byalli451
KnowMe358
C9.Mang0175
ViBE75
PPMD28
Organizations
Other Games
gamesdonequick2235
ComeBackTV 195
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 18 non-featured ]
StarCraft 2
• musti20045 42
• davetesta33
• Kozan
• Migwel
• sooper7s
• AfreecaTV YouTube
• intothetv
• IndyKCrew
• LaughNgamezSOOP
StarCraft: Brood War
• RayReign 61
• Azhi_Dahaki10
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota21236
League of Legends
• Doublelift4877
Other Games
• imaqtpie1171
• Scarra1081
Upcoming Events
Replay Cast
43m
CranKy Ducklings
10h 43m
RSL Revival
10h 43m
MaxPax vs Rogue
Clem vs Bunny
WardiTV Team League
12h 43m
uThermal 2v2 Circuit
17h 43m
BSL
20h 43m
Sparkling Tuna Cup
1d 10h
RSL Revival
1d 10h
ByuN vs SHIN
Maru vs Krystianer
WardiTV Team League
1d 12h
Patches Events
1d 17h
[ Show More ]
BSL
1d 20h
Replay Cast
2 days
Replay Cast
2 days
Wardi Open
2 days
Monday Night Weeklies
2 days
WardiTV Team League
3 days
GSL
4 days
The PondCast
5 days
WardiTV Team League
5 days
Replay Cast
6 days
WardiTV Team League
6 days
Liquipedia Results

Completed

Proleague 2026-03-12
WardiTV Winter 2026
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
Jeongseon Sooper Cup
BSL Season 22
Proleague 2026-03-13
RSL Revival: Season 4
Nations Cup 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual

Upcoming

CSL Elite League 2026
ASL Season 21
Acropolis #4 - TS6
2026 Changsha Offline CUP
Acropolis #4
IPSL Spring 2026
CSLAN 4
HSC XXIX
uThermal 2v2 2026 Main Event
NationLESS Cup
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.